User Tools

Site Tools


workshops:arduino_to_the_next_level:remembering_state

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
workshops:arduino_to_the_next_level:remembering_state [2017-04-05 12:42] – external edit 127.0.0.1workshops:arduino_to_the_next_level:remembering_state [2017-04-11 11:23] (current) Simon
Line 9: Line 9:
 Fortunately there is another area of memory on an Arduino called EEPROM (Electrically Erasable Programmable Read-Only Memory). This can be written to by your Arduino program and will be saved when the Arduino is switched off or reset. Fortunately there is another area of memory on an Arduino called EEPROM (Electrically Erasable Programmable Read-Only Memory). This can be written to by your Arduino program and will be saved when the Arduino is switched off or reset.
  
-There are two functions that you use from http://arduino.cc/en/Reference/EEPROM EEPROM.write and EEPROM.read+There are two [[http://arduino.cc/en/Reference/EEPROM|EEPROM]] functions that you use, EEPROM.write and EEPROM.read
  
-  *  First make sure the EEPROM on your adruino is clear by following this tutorial http://arduino.cc/en/Tutorial/EEPROMClear+  *  First make sure the EEPROM on your adruino is clear by following [[http://arduino.cc/en/Tutorial/EEPROMClear|this tutorial]]
  
-| {{workshops:challenge_yourself.jpg?200x0}}| **Easier****(1)** Connect up a push switch to the Arduino and have it output the number of time the switch has been pushed. You can either display this on the LCD display or onto your laptop serial connection using Serial.println Unplug the power from your Arduino, what happens to the count?**Intermediate****(2)** Modify your program to save the count to EEPROM, so that it is saved when the power goes off and read when the power goes back on. Can you think of any limitations of your solution? |+| {{workshops:challenge_yourself.jpg?200x0}}| **Easier** \\ **(1)** Connect up a push switch to the Arduino and have it output the number of time the switch has been pushed. You can either display this on the LCD display or onto your laptop serial connection using Serial.println Unplug the power from your Arduino, what happens to the count? \\ \\ **Intermediate** \\ **(2)** Modify your program to save the count to EEPROM, so that it is saved when the power goes off and read when the power goes back on. Can you think of any limitations of your solution? |
  
  
Line 22: Line 22:
 The EEPROM in your Arduino is rated by the manufacturer for 100,000 writes, so be aware that you can't write too often. The EEPROM in your Arduino is rated by the manufacturer for 100,000 writes, so be aware that you can't write too often.
  
-In reality it is likely last for more than thathttp://hackaday.com/2011/05/16/destroying-an-arduinos-eeprom/ found over 1,000,000+In reality it can last for more than that [[http://hackaday.com/2011/05/16/destroying-an-arduinos-eeprom/|to over 1,000,000 writes]].
  
workshops/arduino_to_the_next_level/remembering_state.1491396124.txt.gz · Last modified: 2017-04-05 12:42 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki