Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <EEPROM.h>
- struct MyObject {
- char ssid[20]; // 1 more than the length of the array content
- char password[20]; // 1 more than the length of the array content
- };
- void setup() {
- Serial.begin(9600);
- int eeAddress = 0; //Location we want the data to be put.
- EEPROM.begin(1024);
- /** Put is designed for use with custom structures also. **/
- //Data to store.
- MyObject customVar = {
- "your_ssid",
- "your_passwd"
- };
- EEPROM.put(eeAddress, customVar);
- EEPROM.commit();
- Serial.print("Written custom data type! \n\nView the example sketch eeprom_get to see how you can retrieve the values!");
- }
- void loop() {
- /* Empty loop */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement