can't read pinsB and write to EEPROM

jshuman

New Member
This is probably a simple question for the PROs here but .....
How can you take the results from b0=pinsB and use them in the EEPROM command?

Example:
REM Read B.0-B.3 and store into EEPROM memory

SYMBOL ETX = 3 REM End Of Text
SYMBOL SwitchPositions = b0

SwitchPositions = pinsB & %00001111
EEPROM 0,(SwitchPositions, ETX)

------- SYNTAX ERRORS ------------
EEPROM 0,(SwitchPositions, ETX)
^
Error: Syntax error in this line!
-------------------------------------

If I replace SwitchPositions with 15, it works fine.

Thanks in advance for any help.
 

cravenhaven

Senior Member
According to the manual the EEPROM command must be followed by the location and then data.
ie EEPROM <location>,(<data>,<data>.....) eg: EEPROM 0,(1,2,3,4....)

You are trying to replace the <data> portions with variables, which is not supported.
 

MartinM57

Moderator
EEPROM is for loading the eeprom when you program the PICAXE

Have a look at the WRITE (and READ) commands in Manual 2 - they will do exactly what you want...

PS Welcome to the Forum :D
 

jshuman

New Member
Thanks for the quick replies!

I combined a couple of examples together and I guess I wasn't thinking through the process completely.

Thanks again for the help.
 
Top