Syntax and number formating questions
Hi all,
This is my first post and first attempt at a project with a Stamp controller. I have reviewed the BASIC Stamp programming and reference manual and looked through coding examples, but can't seem to find an elegant solution.
I am using the RFID kit with a BS2. I can read tag id's into a 10 byte array using the following;
SERIN RX, T2400, 1000, jump,[noparse][[/noparse]STR buf\10] where buf is defined as Byte(10).
I would like to write this to EEPROM memory. Is there an elegant way to do this? I would like to minimize the number of variables used for reading and writing the RFID tags, as the BS2 has 32 bytes of RAM.
Best,
Chris
This is my first post and first attempt at a project with a Stamp controller. I have reviewed the BASIC Stamp programming and reference manual and looked through coding examples, but can't seem to find an elegant solution.
I am using the RFID kit with a BS2. I can read tag id's into a 10 byte array using the following;
SERIN RX, T2400, 1000, jump,[noparse][[/noparse]STR buf\10] where buf is defined as Byte(10).
I would like to write this to EEPROM memory. Is there an elegant way to do this? I would like to minimize the number of variables used for reading and writing the RFID tags, as the BS2 has 32 bytes of RAM.
Best,
Chris
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Thanks for the reply - I did look at the help files. Based on what I see there - I will need to create 10 seperate variables to write the value I have already in the buf variable.
Is there some way to write this array directly to EEPROM without creating multiple variables?
Thanks again.
Post Edited (Eyepuff2) : 5/28/2008 5:57:38 PM GMT
· WRITE I, Buf[noparse][[/noparse]I]
Next
That's so hard?· And yes, you'll need
I VAR NIB
for this.· Note you can "wear out" EEPROM if you write it 100,000 times or more.· Usually not a problem, depends on how often you'll be updating this string.
Write 0,x0 stores x0 in EEPROM location 0. Then use Write 1, x1, and write 2, x2... up to write 10, x10 in your case for 10 variables. You don't need an array, just make a for-next loop to write them in sequentially as you read the RFID tags, then plan to READ them out from EEPROM sequentially, too.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
Post Edited (erco) : 5/28/2008 9:04:16 PM GMT
Thanks for the help. I think I can make it work.
Nothing is hard when you know how to do it.
Best,
Chris
Any ideas?
got it ... need paranthesis not brackets
Thanks
Post Edited (Eyepuff2) : 5/28/2008 7:27:15 PM GMT
Yeah, somehow when I put "buf" -- it gets converted to italics after that. Interesting.
·