draw-sprite-8x8

nazarijtipusak080/prototype-relay/draw-sprite-8x8

Draw XOD logo. Logo is 128 x 64 pixels.
draw-sprite-8x8
@/draw-sprite-8x8
Draw XOD logo. Logo is 128 x 64 pixels.
DEVwayland/ssd1306-oled-i2c/ssd1306-oled-i2c-device
An SSD1306 OLED device.
Xnumber
Cursor position x coordinate.
Ynumber
Cursor position y coordinate.
UPDpulse
Update. Trigger write to display buffer.
draw-sprite-8x8
DONE
DEV
X
Y
UPD
DONEpulse
Pulses on completion.
To use the node in your project you should have the nazarijtipusak080/prototype-relay 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

nodespace{
// 'sprite', 8x8px
    static const unsigned char sprite [] PROGMEM = {
	   0b00000000,
       0b00000000,
       0b00000000,
       0b00000000,
       0b00000000,
       0b00000000,
       0b00000000,
       0b00000000,
    };
}

node {
    void evaluate(Context ctx) {
        // The node responds only if there is an input pulse
        if (!isInputDirty<input_UPD>(ctx))
            return;

        // Get a pointer to the `Adafruit_SSD1306` class instance
        auto display = getValue<input_DEV>(ctx);
        auto cursor_x = getValue<input_X>(ctx);
        auto cursor_y = getValue<input_Y>(ctx);
        display->drawBitmap(cursor_x, cursor_y,sprite,8,8,1);
        emitValue<output_DONE>(ctx, 1);
    }
}