I copied and pasted the code from the atom pro manual about using formatters to set the number of bytes that the atom pro expects to see in the hserin and the serin commands.
ant var word
bat var word
cat var word
sethserial h2400,h8databits,hnoparity,h1stopbits
hserin [dec4 ant\4, bat, hex3 cat\3]
I get the error: Error: FILE (LINE 5) : [TOKEN ] : Expected , or ]
I get the same error when trying to use specify the number of bytes when using the serin command. Is there something basic that I am missing or is there an error in the documentation? I am interested in communicating between a parallax sx and the atom pro and and between an atom pro and a parallax serial lcd. I seem to recall reading somewhere that parallax products are inverted with respect to the atom pro. Can anyone confirm this?
Yes i had that compiler directive in there. Sorry for not including it the first time i posted. It is kinda frustrating when the coded provided in the reference manual wont even compile.
Is there a different way to format the serial inputs so that i can send word sized variables to the atom rather than just communicating in bytes? All I am trying to do is have an sx send word length variables when i turn on my robot. I guess i could use the pulsin/pulsout commands and communicate with pwm but i would much rather use a form of serial communication.
Looks like its time to email Basic Micro. It would be a shame to have to switch back to a basic stamp after using the atom pro. I would hate to loose hservo. I’ll post whatever i reply i get back from basic micro in case anyone else is interested in using the serin command in this way.
There are several ways to work this out. It might take some experimenting. You might be able to do something like:
MyVar var word
hserin [MyVar.highbyte, MyVar.lowbyte]
Or is the lowbyte sent first in that case reverse this. If the compiler does not allow this, you can read them into some dummy byte variables and construct your word variable. You could send it as Ascii text and do your own parse function, etc.
My guess is AcidTech will be up here soon and hopefully he will have better answers.