arduino:displays_for_classic_arduinos:display_ssd1306_oled_u8glib.ino
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
arduino:displays_for_classic_arduinos:display_ssd1306_oled_u8glib.ino [2018/01/28 04:06] – mithat | arduino:displays_for_classic_arduinos:display_ssd1306_oled_u8glib.ino [2018/01/28 04:09] (current) – mithat | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | <file c++ display_SSD1306_OLED_u8g2.ino> | + | <file c++ display_SSD1306_OLED_u8glib.ino> |
/* | /* | ||
- | | + | |
| | ||
* Test screen update speed with large solid fonts on | * Test screen update speed with large solid fonts on | ||
* a 128x64 OLED screen that uses the SD1306 chip. | * a 128x64 OLED screen that uses the SD1306 chip. | ||
| | ||
- | * Consumes | + | * Consumes |
- | | + | |
| | ||
* Mithat Konar | * Mithat Konar | ||
*/ | */ | ||
- | # | + | |
+ | # | ||
/* | /* | ||
Line 31: | Line 32: | ||
| | ||
- | U8G2_SSD1306_128X64_NONAME_1_4W_HW_SPI | + | U8GLIB_SSD1306_128X64 |
unsigned int counter = 80; | unsigned int counter = 80; | ||
Line 37: | Line 38: | ||
void setup(void) { | void setup(void) { | ||
- | disp.begin(); | ||
disp.setColorIndex(1); | disp.setColorIndex(1); | ||
} | } | ||
Line 43: | Line 43: | ||
void loop(void) { | void loop(void) { | ||
counter = (counter + 1) % 1000; | counter = (counter + 1) % 1000; | ||
- | | + | |
// picture loop | // picture loop | ||
disp.firstPage(); | disp.firstPage(); | ||
do { | do { | ||
- | disp.setFont(u8g2_font_6x13_tr); | + | |
- | disp.drawStr(0, | + | |
+ | disp.drawStr(0, | ||
- | disp.setFont(u8g2_font_logisoso46_tr); | + | disp.setFont(u8g_font_fub25r); // the largest font with chars that ships w/ lib |
String(counter).toCharArray(dispStr, | String(counter).toCharArray(dispStr, | ||
disp.drawStr( 0, 63, dispStr); | disp.drawStr( 0, 63, dispStr); | ||
} while ( disp.nextPage() ); | } while ( disp.nextPage() ); | ||
- | /* inherent frame rate is about 13 fps with 16 MHz processor | + | // rebuild the picture after some delay |
- | | + | |
delay(500); | delay(500); | ||
} | } | ||
</ | </ |
arduino/displays_for_classic_arduinos/display_ssd1306_oled_u8glib.ino.txt · Last modified: 2018/01/28 04:09 by mithat