Serial Write() Hangs
in
Core Library Questions
•
2 years ago
I'm using the serial library to send out a 128 element char array. I send out the bytes one at a time, and then print the index. There is no response expected from the piece of hardware I'm communicating with while the packet is being sent. This works great on my XP computer, but on Vista, it hangs during the write() function randomly. The piece of code that it hangs on is copied below, and I'm getting really confused. Processing just stops in the middle of the for loop. It always hangs at
different times (it'll get through this piece of code a few times before failing, and never fails at the same index). I'd really appreciate any ideas. Thanks.
- for (int i = 0; i<128; i++){
myPort.write(pageSend[i]);
println(i);
}
1