To use the node in your project you should have the cs/test-ds1302 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
struct State {
};
{{ GENERATED_CODE }}
void evaluate(Context ctx) {
emitValue<output_1302U0027>(ctx, getValue<input_1302>(ctx));
if (!isInputDirty<input_SET>(ctx)) {
return;
}
auto rtc = getValue<input_1302>(ctx);
// Set SS, MM, HH, DW, DD, MM, YYYY
rtc->setDS1302Time((uint8_t)getValue<input_Second>(ctx), (uint8_t)getValue<input_Minute>(ctx),
(uint8_t)getValue<input_Hour>(ctx), (uint8_t)getValue<input_WeekDay>(ctx),
(uint8_t)getValue<input_Day>(ctx),(uint8_t)getValue<input_Month>(ctx),
(uint8_t)getValue<input_Year>(ctx));
emitValue<output_DONE>(ctx, 1);
}