|
|||||||||||
At 3:16, the controller woke up, read its EEPROM, saw “3:00 AM” in address ‘0’, and went back to sleep until tomorrow.
For a test, she didn’t use water. She used a stopwatch and a simple LED. The flowchart was modified: water valve replaced by “Turn LED on for 1 second.” The EEPROM stored the count of how many times the LED had blinked since the beginning of time.
The problem was immediate. The controller had a “last_watering” variable. But this variable lived in RAM—the chip’s short-term memory. Every time a lightning storm flickered the power line, or even when the sun baked the control box to 60 degrees Celsius, the chip would reset. And RAM would vanish. The controller would wake up, see a blank “last_watering,” panic, and assume it had never watered anything in its entire life.
At 3:16, the controller woke up, read its EEPROM, saw “3:00 AM” in address ‘0’, and went back to sleep until tomorrow.
For a test, she didn’t use water. She used a stopwatch and a simple LED. The flowchart was modified: water valve replaced by “Turn LED on for 1 second.” The EEPROM stored the count of how many times the LED had blinked since the beginning of time. flowcode eeprom
The problem was immediate. The controller had a “last_watering” variable. But this variable lived in RAM—the chip’s short-term memory. Every time a lightning storm flickered the power line, or even when the sun baked the control box to 60 degrees Celsius, the chip would reset. And RAM would vanish. The controller would wake up, see a blank “last_watering,” panic, and assume it had never watered anything in its entire life. At 3:16, the controller woke up, read its