storing of data in serin
Julius
Posts: 8
I have a string of GPS signal, that I need to store in a variable before I transmit serout via a bluetooth device
to the desktop.
The GPS signal consist of around 50 characters, but I can't seem to store them properly. Below is the code:
bdata VAR Byte(26)
SERIN 8,240,[noparse][[/noparse]STR bdata\26]
'DEBUG STR bdata,CR
SEROUT 1,240,[noparse][[/noparse]STR bdata\26]
GOTO main
I can't seem to declare more than 26 bytes space for bdata. Is there another way of storing 50 characters?
Thank you!
to the desktop.
The GPS signal consist of around 50 characters, but I can't seem to store them properly. Below is the code:
bdata VAR Byte(26)
SERIN 8,240,[noparse][[/noparse]STR bdata\26]
'DEBUG STR bdata,CR
SEROUT 1,240,[noparse][[/noparse]STR bdata\26]
GOTO main
I can't seem to declare more than 26 bytes space for bdata. Is there another way of storing 50 characters?
Thank you!
Comments
Or, use a BS2sx which has 63 bytes of scratchpad memory in which you can store a whole string before sending to the the PC.
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
I'm using tbe Bs2sx.
Grab 25 characters with a SERIN command and use the PUT command in a loop to put each character into the scratch pad.
Use a second SERIN with SKIP as described above and grab a second 25 characters. Again, use a loop with PUT to load each character into the scratchpad, being careful not to overwrite what you already put there.
Then use a loop with a GET command to send the string out with a SEROUT to the PC.
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
Tom has provided a solution for the BS2sx. If you should get a BS2p series I can post the code we use to input an NMEA string into the SPRAM. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
is there a way to re-declare variables after i run the "retrieve GPS" subroutine?
So I can free up RAM for other variables in the program.
Thanks!