set-rotation

wayland/sensecap-indicator-gfx/set-rotation

Set rotation of display.
set-rotation
@/set-rotation
Set rotation of display.
DEV@/display
A SenseCAP Indicator display.
Rotatebyte
Rotation. Options: 00h (0º), 01h (90º), 02h (180º) and 03h (270º). N.B. the lcd-device node sets the rotation to 03h (270º) as this is the most commonly used orientation.
UPDpulse
Update.
set-rotation
Done
DEV
Rotate
UPD
Donepulse
Pulse on completion.
To use the node in your project you should have the wayland/sensecap-indicator-gfx 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 evaluate_on_pin disable
#pragma XOD evaluate_on_pin enable input_UPD

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 `TFT_eSPI tft` class instance
        auto tft = getValue<input_DEV>(ctx);

        tft -> setRotation(getValue<input_Rotate>(ctx));

        emitValue<output_Done>(ctx, 1);
    }
}