Passing a byte of a word variable (local)
Duffer
Posts: 374
In PBasic, the following works just fine.
count· VAR Word
.
.
·SEROUT TxPin, BRate, [noparse][[/noparse]DEC3 count]
I'm trying to do the same thing in SPIN and can't seem to get it to work...
I'm using the FullDuplexSerial.spn object and I understand that local variables (in my case, Temp) are word length, so
SERIAL.tx(Temp)···· won't do what I want
I've looked at various forms of the BYTE declarative, i.e. SERIAL.tx(Temp.byte[noparse][[/noparse]0]);· also without success.· BTW, Temp is always <= 254
I guess I need to find a way to send a byte sized numeric or a string as in··· string(???????)
or is there a way to send the address of the LSB of Temp? And would that work with the FullDuplexSerial object?
If someone could point me in the right direction (or to the page I didn't read carefully enough , I would be grateful.
Steve
count· VAR Word
.
.
·SEROUT TxPin, BRate, [noparse][[/noparse]DEC3 count]
I'm trying to do the same thing in SPIN and can't seem to get it to work...
I'm using the FullDuplexSerial.spn object and I understand that local variables (in my case, Temp) are word length, so
SERIAL.tx(Temp)···· won't do what I want
I've looked at various forms of the BYTE declarative, i.e. SERIAL.tx(Temp.byte[noparse][[/noparse]0]);· also without success.· BTW, Temp is always <= 254
I guess I need to find a way to send a byte sized numeric or a string as in··· string(???????)
or is there a way to send the address of the LSB of Temp? And would that work with the FullDuplexSerial object?
If someone could point me in the right direction (or to the page I didn't read carefully enough , I would be grateful.
Steve
Comments
SERIAL.DEC(Temp)
using TX is the same as DEBUG Temp (sends it as a byte value instead of a numeric string)
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies