Your code:
Code:
write 200,"+" : write 201,"4" : write 202,"4" : write 203,"7" : write 204,"8" : write 205,"3" : write 206,"2" : write 207,"2" : write 208,"2" : write 209,"5" : write 210,"1" : write 211,"7" : write 212,"4" ' this is all in one line
for c=200 to 212
read c,my[c-200]
next c
You can write eeprom only once when you program your pic with this instruction at the begining of your program:
Code:
EEPROM 200,[43,52,52,55,56,51,50,50,50,53,49,55,52]
'In your code when you need to load the number then
for c=200 to 212
read c,my[c-200]
next c
But you should avoid to use this peace of code (In red) otherwise you will erase your phone #
Code:
read 230,a : read 231,b : read 232,c
if a<>"6" and b<>"8" and c<>"4"then
for c=0 to 255
write c,0
next c
...........
...........
You should use this instead, so you will save your number.
Code:
read 230,a : read 231,b : read 232,c
if a<>"6" and b<>"8" and c<>"4"then
for c=0 to 199
write c,0
next c
..........
..........
In order to avoid holes in the eeprom you can change location to your phone # like this:
Code:
EEPROM 243,[43,52,52,55,56,51,50,50,50,53,49,55,52]
'In your code when you need to load the number then
for c=243 to 255
read c,my[c-243]
next c
In this case you could erase up to location 242 and still save you phone #.
Code:
read 230,a : read 231,b : read 232,c
if a<>"6" and b<>"8" and c<>"4"then
for c=0 to 242
write c,0
next c
..........
..........
Al.
Bookmarks