matrix-dev

cesars/matrix/matrix-dev

Control Matrix with MAX7219 - MAX7221
matrix-dev
@/matrix-dev
Control Matrix with MAX7219 - MAX7221
dtPinport
Data pin
clkPinport
Clock pin
csPinport
CS pin
nDevnumber
Number of devices 1-8
matrix-dev
dtPin
clkPin
csPin
nDev
72XX'
72XX'@/matrix-dev
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;}
}