eduardomorais
11-20-2010, 06:06 PM
Hello everyone!
I have a question about how he could control a buffer in communication between the computer and parallax.
How do I compare to securely deliver information I'm getting the computer in the form of bytes, with a reference value?
Below is a code I made for the function of ascending desemprenhar LEDs according to comparison even. However it is not working properly.:confused:
------------------------------------------------------------------------
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
OBJ
Parallax: "Nomad"
PC: "FullDuplexSerial"
PUB Main
Parallax.start(0, 0, 19_200)
PC.start(31, 30, 0, 9_600)
Repeat
dirA[16..23]~~
longfill(@rx_comando, 0, 4)
rx_comando := PC.RX
'My question is why this works
'-----------------------------
CASE || rx_comando
QPOS : !outA[16]
CLRP : !outA[23]
'------------------------------
longmove(@tx_comando, @rx_comando, 1)
PC.TX(tx_comando)
waitcnt(clkfreq + cnt)
DAT
rx_comando long
tx_comando long
QPOS byte "08", 0
CLRP byte "28", 0
I have a question about how he could control a buffer in communication between the computer and parallax.
How do I compare to securely deliver information I'm getting the computer in the form of bytes, with a reference value?
Below is a code I made for the function of ascending desemprenhar LEDs according to comparison even. However it is not working properly.:confused:
------------------------------------------------------------------------
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
OBJ
Parallax: "Nomad"
PC: "FullDuplexSerial"
PUB Main
Parallax.start(0, 0, 19_200)
PC.start(31, 30, 0, 9_600)
Repeat
dirA[16..23]~~
longfill(@rx_comando, 0, 4)
rx_comando := PC.RX
'My question is why this works
'-----------------------------
CASE || rx_comando
QPOS : !outA[16]
CLRP : !outA[23]
'------------------------------
longmove(@tx_comando, @rx_comando, 1)
PC.TX(tx_comando)
waitcnt(clkfreq + cnt)
DAT
rx_comando long
tx_comando long
QPOS byte "08", 0
CLRP byte "28", 0