To use the node in your project you should have the cesars/matrix 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/wayoda/LedControl"
{{#global}}
#include <LedControl.h>
{{/global}}
struct State {
int mem[sizeof(LedControl)];
};
using Type = LedControl*;
{{ GENERATED_CODE }}
void evaluate(Context ctx) {
if (isSettingUp()){
auto state = getState(ctx);
auto dataPin = (uint8_t)getValue<input_dtPin>(ctx);
auto clkPin = (uint8_t)getValue<input_clkPin>(ctx);
auto csPin = (uint8_t)getValue<input_csPin>(ctx);
auto numDevices = (uint8_t)getValue<input_nDev>(ctx);
Type led = new (state->mem) LedControl(dataPin, clkPin, csPin, numDevices);
emitValue<output_72XXU0027>(ctx, led);
return;}
}