How to use SPSTR in basic stamp?
pathikgohil85
Posts: 21
Hello Folks,
I am trying to use SPSTR in my programming. I want to know that how will I use it in SERIN statement and how do I read from SRAM?
Pathik Gohil
I am trying to use SPSTR in my programming. I want to know that how will I use it in SERIN statement and how do I read from SRAM?
Pathik Gohil
Comments
Thanks for reply. I did read about SPSTR on page 404 but that information is not clear to me. I am looking an example which explains me how will I implement in statement.
Pathik Gohil
SERIN <pin>, <Baud>, [SPSTR 5]
This can be included with other formatters to input numbers (DEC or HEX or BIN) or to wait for a specific string to appear (WAIT).
The examples in the Manual under GET and PUT are pretty thorough.
SERIN 16,1,700,TIMO, [SPSTR 27]
How will i read my contains from RAM?
Should I run loop from 0-127 and use GET command?
Pathik
Problem I am facing over here is, Using SPSTR will store my values in HEX. I want to store my values in variables in decimal.
I hope that I made my problem statement clear.
Pathik Gohil
Example:
RX/s0/s3/s, where /s stands for a blank space, it will be stored in the S-RAM as
52
58
20
30
20
33
20
52 stands for R
58 for X
20 for space
30 for 0
33 for 3
These are ASCII values.
I have to read them again in same manner.
Pathik
As Mike said, if they come in that way (ASCII values), they will be read that way. The values do not change when stored in SPRAM. There are merely a sequence of bytes and you can store them into variables from the SPRAM. In what manner do you want them stored in variables?
Yes I got them. I am converting them in to Character before I send them. I am using LabView as GUI which converts them. When I read them, I want them in to decimal again.
Pathik Gohil
Thanks a lot guys.