hc595-device

bradzilla84/74hc595/hc595-device

Hardware Setup Block
hc595-device
@/hc595-device
Hardware Setup Block
DSport
DATA SERIAL (Pin 14 on the chip)
CLKport
CLOCK(Pin 11 on the chip)
LTport
LATCH (Pin 12 on the chip)
SRnnumber
Number of Chained IC's
hc595-device
DS
CLK
LT
SRn
DEV
DEV@/hc595-device
Output from setup.
To use the node in your project you should have the bradzilla84/74hc595 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/Simsso/ShiftRegister74HC595"


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

struct State {
    uint8_t mem[sizeof(ShiftRegister74HC595)];
};

// Define our custom type as a pointer on the class instance.
using Type = ShiftRegister74HC595*;

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    if (!isSettingUp())
        return;

    auto state = getState(ctx);

    // Create a new object in the memory area reserved previously.
    Type sr = new (state->mem) ShiftRegister74HC595(getValue<input_SRn>(ctx),getValue<input_DS>(ctx), getValue<input_CLK>(ctx), getValue<input_LT>(ctx));
    emitValue<output_DEV>(ctx, sr);
}