Stamp AI "END Statement" Ramifications
Humanoido
Posts: 5,770
When a program is ended (BS1), and power is kept on,
the memory and variables are retained. This is a kind of
hibernation or suspended animation.
After the END statement is executed, and the program ends,
is there any simple way to retrieve data from the eeprom and/or
run the program again?
Obviously we cannot reset the stamp or recycle power, or
everything will be lost.
I am dealing with an AI life form and don't want it to die. Of
course, instead of an END statement, the code could end in
a continuous loop. Inside the loop, it looks at a pin. If the
pin goes high, the program goes back to the beginning or
somewhere in between.
Thoughts, ideas, comments welcome.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
humanoido
*Stamp SEED Supercomputer *Basic Stamp Supercomputer *TriCore Stamp Supercomputer
*Minuscule Stamp Supercomputer *Three Dimensional Computer *Penguin with 12 Brains
*Penguin Tech *StampOne News! *Penguin Robot Society
the memory and variables are retained. This is a kind of
hibernation or suspended animation.
After the END statement is executed, and the program ends,
is there any simple way to retrieve data from the eeprom and/or
run the program again?
Obviously we cannot reset the stamp or recycle power, or
everything will be lost.
I am dealing with an AI life form and don't want it to die. Of
course, instead of an END statement, the code could end in
a continuous loop. Inside the loop, it looks at a pin. If the
pin goes high, the program goes back to the beginning or
somewhere in between.
Thoughts, ideas, comments welcome.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
humanoido
*Stamp SEED Supercomputer *Basic Stamp Supercomputer *TriCore Stamp Supercomputer
*Minuscule Stamp Supercomputer *Three Dimensional Computer *Penguin with 12 Brains
*Penguin Tech *StampOne News! *Penguin Robot Society
Comments
So before the END statement, the code should write all necessary variables to eeprom, then read the variables back in after a power recycle or reset. Does that sound correct?
You should define the initial state of the variable values using the EEPROM statement since that will be what's initially there when you download the program.