diff options
author | Jakob Stendahl <jakob.stendahl@outlook.com> | 2017-10-24 21:05:09 +0200 |
---|---|---|
committer | Jakob Stendahl <jakob.stendahl@outlook.com> | 2017-10-24 21:05:09 +0200 |
commit | 96236ad238dfce3ec8bdc330b44d0b319c8447ef (patch) | |
tree | c4b8fa3726cf946f627c5b4abd4c34f63d36d862 /memoryAccess.cpp | |
parent | a72e2f01a85370635ef8b1cb6d9cde5c91ee5815 (diff) | |
download | Luxcena-cs-96236ad238dfce3ec8bdc330b44d0b319c8447ef.tar.gz Luxcena-cs-96236ad238dfce3ec8bdc330b44d0b319c8447ef.zip |
Added write and commit method
Diffstat (limited to 'memoryAccess.cpp')
-rw-r--r-- | memoryAccess.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/memoryAccess.cpp b/memoryAccess.cpp index ed64102..6745a63 100644 --- a/memoryAccess.cpp +++ b/memoryAccess.cpp @@ -22,11 +22,19 @@ struct memoryAdress memoryAccess::getAdress(String varName) { else if ((String) "deviceName" == varName) { tmp = {20, 69}; } else if ((String) "deviceLocation" == varName) { tmp = {70, 119}; } else if ((String) "SSID" == varName) { tmp = {120, 269}; } - else if ((String) "Password" == varName) { tmp = {270, 219}; } - else { Serial.println("UNKNOWN MEMNAME"); } + else if ((String) "Password" == varName) { tmp = {270, 319}; } + else { + Serial.println(""); + Serial.print("UNKNOWN MEMNAME: "); + Serial.println(varName); + } return tmp; } +void memoryAccess::write(int location, byte val) { + EEPROM.write(location, val); +} + bool memoryAccess::writeAscii(String varName, String data) { /* Write ascii string to EEPROM */ struct memoryAdress memAdress = this->getAdress(varName); |