This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
arduino-docs [2015/05/05 19:08] russmathis |
arduino-docs [2015/07/19 01:19] apedro [EEPROM] |
||
---|---|---|---|
Line 8: | Line 8: | ||
==== Wire ==== | ==== Wire ==== | ||
+ | content | ||
- | +=== EEPROM ==== | + | ==== EEPROM ==== |
EEPROM functionality is similar to the standard Arduino library with the exception of having to declare memory size and committing writes. | EEPROM functionality is similar to the standard Arduino library with the exception of having to declare memory size and committing writes. | ||
- | |||
===example=== | ===example=== | ||
- | |||
- | |||
<code c++> | <code c++> | ||
- | |||
#include <EEPROM.h> | #include <EEPROM.h> | ||
- | |||
void setup() | void setup() | ||
{ | { | ||
Line 35: | Line 30: | ||
Find the EEPROMAnything.h and add EEPROM.commit(); after the EEPROM.write(ee++, *p++); | Find the EEPROMAnything.h and add EEPROM.commit(); after the EEPROM.write(ee++, *p++); | ||
- | EEPROMAnything provides nice functionality to save any type of variables including structers. | + | EEPROMAnything provides nice functionality to save any type of variable including structers. |
<code c++> | <code c++> | ||
#include <EEPROMAnything.h> | #include <EEPROMAnything.h> | ||
struct eepromInfoType | struct eepromInfoType | ||
{ | { | ||
- | uint8_t My8In; | + | uint8_t MyUnsigned8BitInt; |
char MyCharArray[25] | char MyCharArray[25] | ||
} myStructOriginal, myStructCopy; | } myStructOriginal, myStructCopy; | ||
Line 47: | Line 41: | ||
void setup() | void setup() | ||
{ | { | ||
- | myStruct.My8Int = 0; //assign some value | + | myStructOriginal.MyUnsigned8BitInt = 0; //assign some value |
- | strcpy( MyCharArray, "Less than 25 chars" ); //assign some value | + | strcpy( myStructOriginal.MyCharArray, "Less than 25 chars" ); //assign some value |
EEPROM_writeAnything( 0, myStructOriginal ); //remember to modify EEPROM_writeAnything by adding .commit(). | EEPROM_writeAnything( 0, myStructOriginal ); //remember to modify EEPROM_writeAnything by adding .commit(). | ||
//Lets read it back | //Lets read it back | ||
Line 54: | Line 48: | ||
} | } | ||
- | void loop() {//nothing here} | + | void loop() |
+ | { | ||
+ | //nothing here | ||
+ | } | ||
</code> | </code> | ||
- | |||
- | |||
- | ==== EEPROM ==== | ||
- | |||
- | content | ||
===== ESP Specific Libs ===== | ===== ESP Specific Libs ===== | ||
Line 122: | Line 114: | ||
**Connect with static IP** | **Connect with static IP** | ||
+ | |||
+ | If you experience problems regarding DNS resolving check out https://github.com/esp8266/Arduino/issues/369 | ||
<code c> | <code c> | ||
#include <ESP8266WiFi.h> | #include <ESP8266WiFi.h> |