send-command

wayland/nextion/send-command

Send any command in the Nextion instruction set to the touchscreen. https://nextion.tech/instruction-set/
send-command
@/send-command
Send any command in the Nextion instruction set to the touchscreen. https://nextion.tech/instruction-set/
DEV@/nextion-serial
A nextion device.
CMDstring
Command.
UPDpulse
Update.
send-command
DEV
CMD
UPD
Done
Donepulse
Pulse when command sent.
To use the node in your project you should have the wayland/nextion 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

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 `EasyNex` class instance
        auto eznex = getValue<input_DEV>(ctx);
        auto xStringCmd = getValue<input_CMD>(ctx);

        int N=length(xStringCmd) + 1;
        char cStringCmd[N];
        for(int i=0;i<N;i++)
            cStringCmd[i]=0;
        dump(xStringCmd, cStringCmd);

        eznex -> writeStr(cStringCmd);
        emitValue<output_Done>(ctx, 1);
    }
}