A class for managing SSD1306 controlled LCD´s (cheap 128x64 models, 0.96'')
Dependents: mbed_ssd1306 USB_meter_SD_file_number_filtro_for EscanerRf escaner_RTOS ... more
Revision 9:57209a7e9cba, committed 2017-11-06
- Comitter:
- rodriguj
- Date:
- Mon Nov 06 18:35:22 2017 +0000
- Parent:
- 8:09b1578f93d9
- Commit message:
- Added example code. Small fix.
Changed in this revision
ssd1306.cpp | Show annotated file Show diff for this revision Revisions of this file |
ssd1306.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 09b1578f93d9 -r 57209a7e9cba ssd1306.cpp --- a/ssd1306.cpp Mon Nov 06 18:22:22 2017 +0000 +++ b/ssd1306.cpp Mon Nov 06 18:35:22 2017 +0000 @@ -537,40 +537,40 @@ qpixel_x[0] = x; qpixel_y[0] = y; - scr.plot (x, y, SSD1306::Normal); + plot (x, y, SSD1306::Normal); while (wqueue != rqueue) { x = qpixel_x[rqueue]; y = qpixel_y[rqueue]; rqueue++; - if (x!=127 && !scr.point (x+1,y)) + if (x!=127 && !point (x+1,y)) { - scr.plot (x+1, y, SSD1306::Normal); + plot (x+1, y, SSD1306::Normal); qpixel_x[wqueue] = x+1; qpixel_y[wqueue] = y; wqueue++; } - if (x!=0 && !scr.point (x-1,y)) + if (x!=0 && !point (x-1,y)) { - scr.plot (x-1, y, SSD1306::Normal); + plot (x-1, y, SSD1306::Normal); qpixel_x[wqueue] = x-1; qpixel_y[wqueue] = y; wqueue++; } - if (y!=63 && !scr.point (x,y+1)) + if (y!=63 && !point (x,y+1)) { - scr.plot (x, y+1, SSD1306::Normal); + plot (x, y+1, SSD1306::Normal); qpixel_x[wqueue] = x; qpixel_y[wqueue] = y+1; wqueue++; } - if (y!=0 && !scr.point (x,y-1)) + if (y!=0 && !point (x,y-1)) { - scr.plot (x, y-1, SSD1306::Normal); + plot (x, y-1, SSD1306::Normal); qpixel_x[wqueue] = x; qpixel_y[wqueue] = y-1; wqueue++;
diff -r 09b1578f93d9 -r 57209a7e9cba ssd1306.h --- a/ssd1306.h Mon Nov 06 18:22:22 2017 +0000 +++ b/ssd1306.h Mon Nov 06 18:35:22 2017 +0000 @@ -81,10 +81,10 @@ * lcd.cls(); // clear frame buffer * lcd.locate (3,1); // set text cursor to line 3, column 1 * lcd.printf ("Hello, world!"); // print to frame buffer - * lcd.line ( 7, 23, 113, 23, SSD1306::Normal); // - * lcd.line (113, 23, 113, 32, SSD1306::Normal); // Surrounds text with - * lcd.line (113, 32, 7, 32, SSD1306::Normal); // a rectangle - * lcd.line ( 7, 32, 7, 23, SSD1306::Normal); // + * lcd.line ( 6, 22, 114, 22, SSD1306::Normal); // + * lcd.line (114, 22, 114, 33, SSD1306::Normal); // Surrounds text with + * lcd.line (114, 33, 6, 33, SSD1306::Normal); // a rectangle + * lcd.line ( 6, 33, 6, 22, SSD1306::Normal); // * lcd.fill (0, 0); // fills screen outside rectangle * lcd.redraw(); // updates actual display transferring frame buffer over I2C bus * while (1) {