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
#pragma XOD require "https://github.com/Cesar-S/virtuabotixRTC"
#pragma XOD error_raise enable
#pragma XOD error_catch enable
{{#global}}
#include <virtuabotixRTC.h>
{{/global}}
struct State {
uint8_t mem[sizeof(virtuabotixRTC)];
};
using Type = virtuabotixRTC*;
{{ GENERATED_CODE }}
void evaluate(Context ctx) {
if (!isSettingUp())
return;
auto state = getState(ctx);
Type rtc = new (state->mem) virtuabotixRTC((uint8_t)getValue<input_RST>(ctx),(uint8_t)getValue<input_SCLK>(ctx),
(uint8_t)getValue<input_IO>(ctx));
rtc->_DS1302_start();
emitValue<output_1302U0027>(ctx, rtc);
}