receiveByte() without waiting
Hello forummembers,
I'm having a problem with the receiveByte() command.
The program communicates through the EB500 module to my laptop.
My program in a short version is this:
while ( data != '0' ) {
· // the program here
·
· if (EB500RX.byteAvailable()) {
··· data = (char) EB500RX.receiveByte();
· }
}
The idea is to execute the program continiously untill i give the 0 command on my laptop. So if·the EB500 module·receives nothing, he doesnt need to wait (receiveByte() does that) for data but needs to go on with the program.
Is there any way to accomplish this without reprogramming the UART.java? or is this necessary?
thanks in advance!
I'm having a problem with the receiveByte() command.
The program communicates through the EB500 module to my laptop.
My program in a short version is this:
while ( data != '0' ) {
· // the program here
·
· if (EB500RX.byteAvailable()) {
··· data = (char) EB500RX.receiveByte();
· }
}
The idea is to execute the program continiously untill i give the 0 command on my laptop. So if·the EB500 module·receives nothing, he doesnt need to wait (receiveByte() does that) for data but needs to go on with the program.
Is there any way to accomplish this without reprogramming the UART.java? or is this necessary?
thanks in advance!
Comments
If the EB500 has no data sent, the EB500RX.byteAvailable will be false,
and EB500RX.receiveByte() is not called, hence no wait.
If the EB500 has sent data, the EB500RX.byteAvailable will be true and
EB500RX.receiveByte() is called, but since there is data. it is immediately
returned, so no wait either.
regards peter