MCPcopy Create free account
hub / github.com/PricelessToolkit/MailBoxGuard / setPixel

Method setPixel

Code/Arduino_libraries/SSD1306/OLEDDisplay.cpp:137–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137void OLEDDisplay::setPixel(int16_t x, int16_t y) {
138 if (x >= 0 && x < this->width() && y >= 0 && y < this->height()) {
139 switch (color) {
140 case WHITE: buffer[x + (y / 8) * this->width()] |= (1 << (y & 7)); break;
141 case BLACK: buffer[x + (y / 8) * this->width()] &= ~(1 << (y & 7)); break;
142 case INVERSE: buffer[x + (y / 8) * this->width()] ^= (1 << (y & 7)); break;
143 }
144 }
145}
146
147void OLEDDisplay::setPixelColor(int16_t x, int16_t y, OLEDDISPLAY_COLOR color) {
148 if (x >= 0 && x < this->width() && y >= 0 && y < this->height()) {

Callers

nothing calls this directly

Calls 2

widthMethod · 0.95
heightMethod · 0.95

Tested by

no test coverage detected