Serial Communication (Parallax <-> PC)
Hello friends!
I'm working on a project that uses USB communication between a computer and a board propeller parallax.
I need a method that receives bytes from the USB and performs some tasks in accordance with such received bytes.
As the size of the received words will be something "random", I have to develop a method that will read in SPIN indefinitely from USB only stopping when a stop condition, for example a character
'\ r', is introduced to it.
I tried to do that anyway. Could anyone tell me another way of doing or where I'm wrong, because is not working that way.
C
I'm working on a project that uses USB communication between a computer and a board propeller parallax.
I need a method that receives bytes from the USB and performs some tasks in accordance with such received bytes.
As the size of the received words will be something "random", I have to develop a method that will read in SPIN indefinitely from USB only stopping when a stop condition, for example a character
'\ r', is introduced to it.
I tried to do that anyway. Could anyone tell me another way of doing or where I'm wrong, because is not working that way.
C

Comments
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 NL = %00001101'= '\r' OBJ PC: "FullDuplexSerial" VAR byte teste PUB Main dirA[16..23]~~ PC.start(31, 30, 0, 9_600) lerserial Pub lerserial Repeat until teste == nl teste := pc.rx case teste %01000001: !outA[16] '65 A %01000010: !outA[17] '66 B OTHER : !outa[16..17]