SEROUT, DATA and STR question
daviddrake
Posts: 20
I am using the SEROUT command, with some rather long strings, such as 28 bytes in length. Can the SEROUT properly understand the following:?
test DATA 1,2,3,4,5 '' fake data
SEROUT kout,baud, [noparse][[/noparse]STR test\5]
Or will this only work with byte arrays and so require the transfer of the "test" contents to a byte array?
Your help is appreciated!
David Drake
test DATA 1,2,3,4,5 '' fake data
SEROUT kout,baud, [noparse][[/noparse]STR test\5]
Or will this only work with byte arrays and so require the transfer of the "test" contents to a byte array?
Your help is appreciated!
David Drake
Comments
David Drake
·· Probably what you·will have to do is read your data from the EEPROM and send it out to the serial port 1 byte at a time.· If you do this within a loop it should work for you.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
TNX -DD
·· I probably made more work for you, which was not my intention.· Re-reading the original post, I was thinking, if you're using the SPRAM for the data, there's no need to write it to EEPROM before sending it out.· You can do a loop and get it one character at a time from the SPRAM just the same as you could from the EEPROM.· Sorry if we were on different topics.· I wasn't clear on whether you are or aren't using the SPRAM.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
DD
Msg1··· DATA··· "Parallax rocks!", 0
Msg2··· DATA··· "The BASIC Stamp", CR, "Embedded control made simple!", 0
You can send either string with this subroutine:
Send_Str:
· DO
··· READ eeAddr, char
··· eePntr = eePntr + 1
··· IF (char = 0) THEN EXIT
··· SEROUT SPin, Baud, [noparse][[/noparse]char]
· LOOP
· RETURN
Here's how you send a specific string:
Main:
· eePntr = Msg1
· GOSUB Send_Str
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
·· Anyone using the SPSTR command should know what SPRAM is.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
·· No biggie, I will endeavor to be more clear in my posts.· Thanks for your concern and input.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com