Shop OBEX P1 Docs P2 Docs Learn Events
Passing a byte of a word variable (local) — Parallax Forums

Passing a byte of a word variable (local)

DufferDuffer Posts: 374
edited 2007-07-19 02:32 in Propeller 1
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 enoughconfused.gif , I would be grateful.

Steve

Comments

Sign In or Register to comment.