pixel

yzheka-m/nokia-5510-display/pixel

No description
pixel
@/pixel
DISPLAY@/display
Display object
POSITION@/point
position on screen
BLACKboolean
Black or white color
pixel
DISPLAY
POSITION
BLACK
DONE
DONEpulse
pulse when pixel in on the screen
To use the node in your project you should have the yzheka-m/nokia-5510-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

struct State {
    int x,y;
    bool black,set=false;
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    auto display = getValue<input_DISPLAY>(ctx);
    auto state=getState(ctx);
    if(state->set){
        display->drawPixel(state->x,state->y,state->black?WHITE:BLACK);
    }
    auto point = getValue<input_POSITION>(ctx);
    state->x=point->x; state->y=point->y;
    state->black=getValue<input_BLACK>(ctx);
    state->set=true;
    display->drawPixel(state->x,state->y,state->black?BLACK:WHITE);
    display->display();
    emitValue<output_DONE>(ctx,1);
}