displaying on SSD1306, 128x64 pixels OLED
Diff: Display.cpp
- Revision:
- 12:b4d5e007640e
- Parent:
- 10:8bf77efd1579
--- a/Display.cpp Tue Feb 25 18:22:01 2020 +0000 +++ b/Display.cpp Tue Feb 25 20:59:35 2020 +0000 @@ -1,102 +1,46 @@ #include "MicroBit.h" #include "Display.h" -/** - * When constructed from MicroBit's MicroBitDisplay of a not yet initialized - * MicroBit object - that must be done before using the Display instance. - * - * @param uDpl is e.g. MicroBit's MicroBitDisplay - */ Display::Display(MicroBitDisplay & uDpl) : uDisplay(uDpl) { clearStick(); } -/** - * Clears the display and its buffer - */ void Display::clear() { uDisplay.image.clear(); clearStick(); } -/** - * The stick's length is represented by the count of digits being 1. - * @param size in range [0,24] - */ void Display::setStick(uint8_t length) { curLength = length; paintStick(&Display::lessCurLength); } -/** - * Set a single dot - * - * @param position in [0,24] for showing that single dot. - */ void Display::setFlag(uint8_t position) { showbit = position; paintStick(&Display::orPoint); } -/** - * Puts a bitpattern in a row - * - * @param rowNr in [0,4] for selected row - * @param rowContent in [0,31] to be shown binary - */ void Display::toRow(uint8_t rowNr, uint8_t rowContent) { this->rowNr=rowNr; showbit=rowContent; paintStick(&Display::bitplot); } -/** - * 25 bits showed in the display as a whole. - * - * @param bits25 contains the 25 bit to be showed - */ void Display::toRows(uint32_t bits25) { showbit=bits25; paintStick(&Display::simplePlot); } -/** - * Vertdecimal is intended for showing a single number in [00000,99999], - * vertical read from top to bottom. - * - * @param r0 bottom row - row 0 - * @param r1 row 1 - * @param r2 row 2 - * @param r3 row 3 - * @param r4 top row - row 4 - */ void Display::vertDecimal(uint8_t r0,uint8_t r1,uint8_t r2,uint8_t r3,uint8_t r4) { vertDecimal(r0,r1,r2,r3,r4,false); } -/** - * Vertdecimal is intended for showing a single number in [00000,99999], - * vertical read from top to bottom. - * - * @param r0 bottom row - row 0 - * @param r1 row 1 - * @param r2 row 2 - * @param r3 row 3 - * @param r4 top row - row 4 - * @param leftDotOn turns left dot on. leftdot is not used to represent a digit in base 10 numbers. - */ void Display::vertDecimal(uint8_t r0,uint8_t r1,uint8_t r2,uint8_t r3,uint8_t r4, bool b15On) { Ledrows lr(r0,r1,r2,r3,r4,b15On); showbit = lr.all; paintStick(&Display::simplePlot); } -/** - * Binary Clock, hours in top rows (4 for multiplum of 10, 3 for remainer) - * minuts in bottom rows (1 for multiplum of 10, 0 for remainer) - * - * @param minuts of the day - */ void Display::vertClock(uint16_t minuts) { uint8_t hours = minuts/60; minuts -= 60*hours; @@ -105,13 +49,6 @@ vertDecimal(minuts-10*m1,m1,16,hours-10*h1,h1,false); } -/** - * Binary Clock, hours in row 4 (top row) - * minuts in rows 3 and 2 (3 for multiplum of 10, 2 for remainer) - * seconds in rows 1 and 0 (1 for multiplum of 10, 0 for remainer) - * - * @param second of the day - */ void Display::vertSecClock(uint32_t seconds) { uint8_t hours = seconds/3600; uint8_t minuts = (seconds - 3600*hours)/60;