tftbutton-device

ivanmason/tft-lcd-touch/tftbutton-device

Crate a Button
tftbutton-device
@/tftbutton-device
Crate a Button
tftbutton-device
DEV
DONE
DONEpulse
DEV@/tftbutton-device
To use the node in your project you should have the ivanmason/tft-lcd-touch 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

{{#global}}
#include <Adafruit_GFX.h>    // Core graphics library 
#include <MCUFRIEND_kbv.h>
{{/global}}


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

using Type = Adafruit_GFX_Button*;

{{ GENERATED_CODE }}

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

    auto state = getState(ctx);

    // Create a new object in the memory area reserved previously.
    Type button = new (state->mem) Adafruit_GFX_Button;
    
    emitValue<output_DEV>(ctx, button);
    emitValue<output_DONE>(ctx, 1);
}