Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#define APENAS_LER
- //#define GRAVAR_TAG
- //#define LIMPAR_EEPROM
- #define APENAS_TAG_SALDO
- #include<EEPROM.h>
- void setup()
- {
- Serial.begin(115200);
- long xpto = 52835;
- long tag = 0xFE5F211F;
- long linguica = 0xFFFFFFFF;
- #ifdef LIMPAR_EEPROM
- for (int i = 0; i < 1024; i++)
- EEPROM.put(i, linguica);
- #endif
- #ifdef GRAVAR_TAG
- EEPROM.put(4, xpto);
- EEPROM.put(8, tag);
- EEPROM.put(12, xpto);
- Serial.println("GRAVAÇÃO OK");
- #endif
- #ifdef APENAS_LER
- for (int i = 0; i < 50; i++) {
- Serial.print(i);
- Serial.print(": ");
- Serial.println(EEPROM.read(i), HEX);
- }
- #endif
- #ifdef APENAS_TAG_SALDO
- long saldo;
- for (int i = 0; i < 64; ) {
- EEPROM.get(i, tag);
- i += 4;
- EEPROM.get(i, saldo);
- Serial.print(i);
- Serial.print(": ");
- Serial.print(tag, HEX);
- Serial.print(": ");
- Serial.println(saldo, HEX);
- i += 4;
- }
- #endif
- }
- void loop()
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement