Spin Language Equivalent?
worthyamherst
Posts: 46
I am wondering how I can send a wait command for the SERIN command. We are communicating between basic stamp and a propeller. We are sending out
SEROUT Tx,Baud, ["!", var] ,
I am wondering what is the spin equivalent for
SERIN Pin, Baud [WAIT ("!"), var]
I am using BS2 Functions and i have
var := bs.serin_char(pin, baud, polarity bits).
How can I make it wait for a "!" ?
SEROUT Tx,Baud, ["!", var] ,
I am wondering what is the spin equivalent for
SERIN Pin, Baud [WAIT ("!"), var]
I am using BS2 Functions and i have
var := bs.serin_char(pin, baud, polarity bits).
How can I make it wait for a "!" ?
Comments
Assuming the below code works at reading in a character,
Then the code below should wait for a "!" character.
Duane
Would the BS2 PBASIC library for the Prop help? The OBEX description says it emulates a lot of the BS2 functions in SPIN.
http://obex.parallax.com/objects/search/?q=bs2&csrfmiddlewaretoken=83ad328c72f0f2e74e707c2a11f75fae
Yeah, it helped. Didnt see the Thansk Guys.
For example, in PBASIC you can send the Set command to the RC-4 relay board like this:
... where addr is the board address, and relays is the relay control bits. I do it this way in Spin:
Don't be fooled into thinking you can use .str() for the whole command; a zero in the command will foul the stream output due to the way the .str() method works.
Note that this assumes that you have a serial object called com1 that has been setup at the correct baud rate.