Help with Compass Apmod and BS2sx
Trepidcat
Posts: 6
I am trying to run the example program for the compass apmod but I am unable to get any headings from the compass. I am using the bs2sx and I am unsure of the baudrate for the serout and serin commands. I've tried looking at the manual and I can not figure out how they got the number for the baudrate they use in the example. Below is the program I am using also the leds do not move on the module when I move the BOE.
'{$STAMP BS2sx}
Heading VAR byte
PAUSE 200
serout 5,17405,[noparse][[/noparse]0] 'the example had 188+$8000 for baudrate (BS2)
do
serout 5,17405,[noparse][[/noparse]"!CM0?"] 'the example had 32+$8000 for baudrate (BS2)
serin 5,17405,[noparse][[/noparse]Heading] 'the example had 32+$8000 for baudrate (BS2)
debug ? Heading
loop
'{$STAMP BS2sx}
Heading VAR byte
PAUSE 200
serout 5,17405,[noparse][[/noparse]0] 'the example had 188+$8000 for baudrate (BS2)
do
serout 5,17405,[noparse][[/noparse]"!CM0?"] 'the example had 32+$8000 for baudrate (BS2)
serin 5,17405,[noparse][[/noparse]Heading] 'the example had 32+$8000 for baudrate (BS2)
debug ? Heading
loop
Comments
·· The answers are in the Help files in the Stamp Editor under the command SEROUT.· The 84 would need to be replaced with 240, or as you have combined the values, 33008.··
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
That did work and now I know why. The Editor help example was very helpful.
Post Edited (Trepidcat) : 8/10/2005 10:03:21 PM GMT