displaying on SSD1306, 128x64 pixels OLED
Diff: Display.cpp
- Revision:
- 7:7b225c565fe6
- Parent:
- 6:c69f08f464b5
- Child:
- 8:5972683a7190
diff -r c69f08f464b5 -r 7b225c565fe6 Display.cpp --- a/Display.cpp Sun Feb 23 01:57:35 2020 +0000 +++ b/Display.cpp Mon Feb 24 14:34:14 2020 +0000 @@ -2,11 +2,11 @@ #include "Display.h" Display::Display(MicroBitDisplay & uDpl) : uDisplay(uDpl) { - for (uint8_t i = 0 ; i < 25; i++) - stick[i]=false; + clearStick(); } -void Display::setPixel(uint8_t x,uint8_t y) { - uDisplay.image.setPixelValue(x,y,1); +void Display::clear() { + uDisplay.image.clear(); + clearStick(); } void Display::setStick(uint8_t length) { @@ -70,6 +70,11 @@ } } +void Display::clearStick() { + for (uint8_t i = 0 ; i < 25; i++) + stick[i]=false; +} + bool Display::orPoint(uint8_t stickPos) { return showbit == stickPos ? 1 : stick[stickPos]; }