Skip to content

Commit 3ea4384

Browse files
committed
add WEMOS D-Duino SSD1306 example
1 parent 158cc12 commit 3ea4384

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Arduino libraries and sketches.
1212
* [Interfacing SSD1306 based OLED displays (SPI)](#interfacing-ssd1306-based-oled-displays-spi)
1313
* [Colorduino RGB matrix driver](#colorduino-rgb-matrix-driver)
1414
* [CJMCU-8x8 RGB matix](#cjmcu-8x8-rgb-matix)
15+
* [WEMOS D-Duino](#wemos-d-duino)
1516

1617
<!-- vim-markdown-toc -->
1718

@@ -63,4 +64,13 @@ An 8x8 LED RGB matrix based on WS2812 "NeoPixels".
6364
6465
<img alt="CJMCU-8*8" width=256 src="images/cjmcu-8x8/cjmcu.jpg">
6566
66-
* see [README of example sketch](cjmcu_8x8_sample/README.md) for detailed information.
67+
### WEMOS D-Duino
68+
69+
The Wemos D-Duino is a ESP8266 board with an integrated SSD1306 OLED display
70+
connected via I2C.
71+
72+
<img alt="wemos-d-duino" width=256 src="images/wemos-d-duino.png">
73+
74+
* see [example sketch](wemos_d_duino) for an example on how to use it with
75+
the u8g2 library.
76+

images/wemos-d-duino.png

468 KB
Loading

wemos_d_duino/wemos_d_duino.ino

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Demo for WEMOS "D-DUINO" w/ I2C SSD1306 based 128x64 OLED module using u8glib2.
3+
*/
4+
5+
#include "U8g2lib.h"
6+
#include <pins_arduino.h>
7+
8+
// connected via I2C D1-SDA, D2-SCL
9+
U8G2_SSD1306_128X64_NONAME_1_SW_I2C u8g2(U8G2_R0, D2 /* SCL */, D1 /* SDA */);
10+
11+
void setup(void) {
12+
u8g2.begin();
13+
}
14+
15+
/* draw something on the display with the `firstPage()`/`nextPage()` loop*/
16+
void loop(void) {
17+
u8g2.firstPage();
18+
do {
19+
u8g2.setFont(u8g2_font_torussansbold8_8r);
20+
u8g2.drawStr(0,20,"WEMOS D-DUINO");
21+
u8g2.drawStr(0,40,"SSD1306 (I2C)");
22+
} while ( u8g2.nextPage() );
23+
delay(1000);
24+
}
25+

0 commit comments

Comments
 (0)