eeprom-read

dancojocaru2000/arduino-eeprom/eeprom-read

Mapped to Arduino's EEPROM.read(addr); https://www.arduino.cc/en/Reference/EEPROMRead
eeprom-read
@/eeprom-read
Mapped to Arduino's EEPROM.read(addr); https://www.arduino.cc/en/Reference/EEPROMRead
ADDRnumber
Address in EEPROM where the value is stored
UPDpulse
Trigger the read function
eeprom-read
ADDR
UPD
VAL
OK
OKpulse
Emitted after calling EEPROM.read
VALbyte
The value returned from EEPROM.read
To use the node in your project you should have the dancojocaru2000/arduino-eeprom library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

#pragma XOD require "https://github.com/dancojocaru2000/ArduinoEEPROM"

{{#global}}
#include <EEPROM.h>
{{/global}}

struct State {
    uint8_t cache = 0;
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    auto state = getState(ctx);

    if (isInputDirty<input_UPD>(ctx)) {
        auto addr = getValue<input_ADDR>(ctx);
        auto result = EEPROM.read(addr);
        state->cache = result;
        emitValue<output_OK>(ctx, true);
    }

    emitValue<output_VAL>(ctx, state->cache);
}