Question about repeat while/until ...
Laurent R
Posts: 27
Hi everybody
I have a problem with a serial communication.
First I through that it don't need anything else than x:= serial.RxHex but when try, it looks like the prop don't wait.
So i I try to use this code to wait a serial command before doing a task but now nothing happens when I send the command.
So if somebody has a idea?
Thanks
Laurent R
I have a problem with a serial communication.
First I through that it don't need anything else than x:= serial.RxHex but when try, it looks like the prop don't wait.
So i I try to use this code to wait a serial command before doing a task but now nothing happens when I send the command.
repeat while x==0 x := serial.RxHex
So if somebody has a idea?
Thanks
Laurent R
Comments
PUB rxcheck : rxbyte
'' Check if byte received (never waits)
'' returns -1 if no byte received, $00..$FF if byte
x := 0
repeat while x==0
x := serial.RxHex
If the var is already designated as zero it might help in case it is reading a command already written somewhere else in the program.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Toys are microcontroled.
Robots are microcontroled.
I am microcontrolled.
Or make the method call part of the conditional:
-Phil
I have another question so i'll open a new tread [noparse]:)[/noparse]