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

Method setPixelColor

Code/Arduino_libraries/SSD1306/OLEDDisplay.cpp:147–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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()) {
149 switch (color) {
150 case WHITE: buffer[x + (y / 8) * this->width()] |= (1 << (y & 7)); break;
151 case BLACK: buffer[x + (y / 8) * this->width()] &= ~(1 << (y & 7)); break;
152 case INVERSE: buffer[x + (y / 8) * this->width()] ^= (1 << (y & 7)); break;
153 }
154 }
155}
156
157void OLEDDisplay::clearPixel(int16_t x, int16_t y) {
158 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