BS2sx variable carryover
This code will not carry the variable a,b,d,e,g over from a write in slot 3. When I put a debug into slot 3 the var. are correct. But when I go back to slot one and then to slot 2, the var. all show as 255.
Help?
Lou
Help?
Lou
Comments
·
·· It appears you’re using the WRITE command to write the variables to EEPROM between slots.· Not only is this not necessary to preserve the variables, but what has most likely happened is that repeated writing to the location has damaged it and it is being read back wrong because that cell is bad.· You can confirm this by writing a simply 3 line program to write a value to the specific location and read it back.· If it’s corrupted then you have your answer.· I hope this helps.· Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Randy
·
·· You actually have a valid point which I did not bother to bring up because of the solution not requiring the READ/WRITE stuff.· But now that you mention it, you are in fact correct.· The reads and writes, while also not required, wouldn’t work anyway because the data would be read from the current program slot, while the intended data was in another slot.· This is an important note for the original poster to realize, and you are also correct that the STORE command only works on BS2p/BS2pe/BS2px models.· This means that only these models of BASIC Stamp can read/write across slots.· Thanks for pointing that out.· I hope it helps others.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
My impression was that you could read/write accross slots. When actually you can only carry a variable accross slots. So now I just go back to the slot that I wrote to and depending on the slot it came from a varriable "a" will be either 1 or 2. A simple line in that slot saying,"IF a=1 THEN GOTO write routine and IF a=2 THEN GOTO read routine.
Problem solved, many thanks.
Lou