Interfacing the MO-SAWR-AS315M to the Boebot
I recently purchased a couple of nice transmitter/receiver kits from another website (I hope Parallax doesn't mind me giving links to other robotics sites)
http://www.sparkfun.com/commerce/product_info.php?products_id=7813
Anyways... both the transmitter and receiver are EXTREMELY easy to wire to the breadboard for the BoeBot, and I can get a signal easily with
serin/serout... but I am not very good at using it.
I seem to get a lot of garbage over the line and I'm unable to clean it up.
What I want to do is very simple, send a binary 1 or 0 and receive it. Possibly sending with HIGH and LOW and receiving with a normal check
to the input pin status. But the problem is the transmitter/receiver set sends entire bytes, not binary... so I was left kind of stumped as to
how to program for the BS2.
I'm a bit of a newbie with this, but I tried my best anyways and ended up kind of "tricking" it into sending numeric signal, then using that
to set a binary variable. This is a long round-about way... on top of that in order to get it to register the numeric signal, I had to prefix it
with a string literal (I used the letter S for start signal)... this doesn't make sense to me because I didn't use the WAIT command.
I also had to append a string literal at the end of the transmission so the signal knows when the number stops (I used the letter E). I understand
this because the DEC command makes it sit and wait until it receives a non-number. It's just kind of annoying and sloppy.
I've also noticed that every once in a while it'll transmit the wrong data. This is equally annoying and I'd like to hear any solutions for fixing this.
Basicly, I'm saying I suck at SERIN/SEROUT. Can someone give me an example of how to do something like this? Maybe a few examples.. one for
a binary transmission, one for a numeric transmission and one for a string literal?
http://www.sparkfun.com/commerce/product_info.php?products_id=7813
Anyways... both the transmitter and receiver are EXTREMELY easy to wire to the breadboard for the BoeBot, and I can get a signal easily with
serin/serout... but I am not very good at using it.
I seem to get a lot of garbage over the line and I'm unable to clean it up.
What I want to do is very simple, send a binary 1 or 0 and receive it. Possibly sending with HIGH and LOW and receiving with a normal check
to the input pin status. But the problem is the transmitter/receiver set sends entire bytes, not binary... so I was left kind of stumped as to
how to program for the BS2.
I'm a bit of a newbie with this, but I tried my best anyways and ended up kind of "tricking" it into sending numeric signal, then using that
to set a binary variable. This is a long round-about way... on top of that in order to get it to register the numeric signal, I had to prefix it
with a string literal (I used the letter S for start signal)... this doesn't make sense to me because I didn't use the WAIT command.
I also had to append a string literal at the end of the transmission so the signal knows when the number stops (I used the letter E). I understand
this because the DEC command makes it sit and wait until it receives a non-number. It's just kind of annoying and sloppy.
I've also noticed that every once in a while it'll transmit the wrong data. This is equally annoying and I'd like to hear any solutions for fixing this.
Basicly, I'm saying I suck at SERIN/SEROUT. Can someone give me an example of how to do something like this? Maybe a few examples.. one for
a binary transmission, one for a numeric transmission and one for a string literal?