Rotates the screen of the display to one of four positions: 0° vertical, 90° horizontal, 180° vertical, and 270° horizontal.
rotate
@/rotate
Rotates the screen of the display to one of four positions: 0° vertical, 90° horizontal, 180° vertical, and 270° horizontal.
Rbyte
Rotation value. Sets the rotation angle. Lies in the range [0, 3] where: 0 is 0° vertical position; 1 is 90° horizontal position; 2 is 180° vertical position; 3 is 270° horizontal position.
DEV@/st7735-device
The display device.
DOpulse
Triggers a new screen rotation.
DONEpulse
Pulses when the screen rotation is done.
DEV'@/st7735-device
The display device.
To use the node in your project you should have the xod-dev/st7735-display 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) {
auto dev = getValue<input_DEV>(ctx);
if (isSettingUp())
emitValue<output_DEVU0027>(ctx, dev);
if (!isInputDirty<input_DO>(ctx))
return;
uint8_t rotation = getValue<input_R>(ctx);
dev->setRotation(rotation);
emitValue<output_DONE>(ctx, 1);
}
}