-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSSD1306.lua
More file actions
34 lines (25 loc) · 762 Bytes
/
Copy pathSSD1306.lua
File metadata and controls
34 lines (25 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
-- For generic SSD1306 no-name display, using i2c port at 128x64 resolution
-- Available compiled-in fonts:
-- font_6x10_tf
-- font_unifont_t_symbols
id = i2c.HW0
-- IO21 on Pin-Header P1
sda = 21
-- IO22 on Pin-Header P1
scl = 22
sla = 0x3C
i2c.setup(id, sda, scl, i2c.FAST)
disp = u8g2.ssd1306_i2c_128x64_noname(id, sla)
disp:setFont(u8g2.font_6x10_tf)
disp:setFontRefHeightExtendedText()
disp:setDrawColor(1)
disp:setFontPosTop()
disp:setFontDirection(0)
disp:clearBuffer()
disp:drawStr(0, 0, "FF-ESP32-OpenMPPT")
disp:drawStr(0, 14, "Init is waiting now")
disp:drawStr(0, 24, "for 5 seconds.")
disp:drawStr(0, 34, "To interrupt booting")
disp:drawStr(0, 44, "type \"stop()\" in")
disp:drawStr(0, 54, "serial terminal.")
disp:sendBuffer()