diff --git a/README.md b/README.md index 987c2891..aeb06675 100644 --- a/README.md +++ b/README.md @@ -398,9 +398,10 @@ disp = u8g.ssd1306_128x64_i2c(sla) ``` SSD1306 via SPI: ```lua -cs = 8 -- GPIO15, pull-down 10k to GND -dc = 4 -- GPIO2 -disp = u8g.ssd1306_128x64_spi(cs, dc) +cs = 8 -- GPIO15, pull-down 10k to GND +dc = 4 -- GPIO2 +res = 0 -- GPIO16, RES is optional YMMV +disp = u8g.ssd1306_128x64_spi(cs, dc, res) ``` This object provides all of u8glib's methods to control the display. diff --git a/lua_examples/u8glib/u8g_bitmaps.lua b/lua_examples/u8glib/u8g_bitmaps.lua index 92b5f7a0..1b388e41 100644 --- a/lua_examples/u8glib/u8g_bitmaps.lua +++ b/lua_examples/u8glib/u8g_bitmaps.lua @@ -14,12 +14,13 @@ function init_spi_display() -- Hardware SPI CLK = GPIO14 -- Hardware SPI MOSI = GPIO13 -- Hardware SPI MISO = GPIO12 (not used) - -- CS and D/C can be assigned freely to available GPIOs - cs = 8 -- GPIO15, pull-down 10k to GND - dc = 4 -- GPIO2 + -- CS, D/C, and RES can be assigned freely to available GPIOs + cs = 8 -- GPIO15, pull-down 10k to GND + dc = 4 -- GPIO2 + res = 0 -- GPIO16 spi.setup(1, spi.MASTER, spi.CPOL_LOW, spi.CPHA_LOW, spi.DATABITS_8, 0) - disp = u8g.ssd1306_128x64_spi(cs, dc) + disp = u8g.ssd1306_128x64_spi(cs, dc, res) end diff --git a/lua_examples/u8glib/u8g_graphics_test.lua b/lua_examples/u8glib/u8g_graphics_test.lua index 8a721e99..27c7a346 100644 --- a/lua_examples/u8glib/u8g_graphics_test.lua +++ b/lua_examples/u8glib/u8g_graphics_test.lua @@ -14,12 +14,13 @@ function init_spi_display() -- Hardware SPI CLK = GPIO14 -- Hardware SPI MOSI = GPIO13 -- Hardware SPI MISO = GPIO12 (not used) - -- CS and D/C can be assigned freely to available GPIOs - cs = 8 -- GPIO15, pull-down 10k to GND - dc = 4 -- GPIO2 + -- CS, D/C, and RES can be assigned freely to available GPIOs + cs = 8 -- GPIO15, pull-down 10k to GND + dc = 4 -- GPIO2 + res = 0 -- GPIO16 spi.setup(1, spi.MASTER, spi.CPOL_LOW, spi.CPHA_LOW, spi.DATABITS_8, 0) - disp = u8g.ssd1306_128x64_spi(cs, dc) + disp = u8g.ssd1306_128x64_spi(cs, dc, res) end diff --git a/lua_examples/u8glib/u8g_rotation.lua b/lua_examples/u8glib/u8g_rotation.lua index 5b20fca8..6d81c779 100644 --- a/lua_examples/u8glib/u8g_rotation.lua +++ b/lua_examples/u8glib/u8g_rotation.lua @@ -14,12 +14,13 @@ function init_spi_display() -- Hardware SPI CLK = GPIO14 -- Hardware SPI MOSI = GPIO13 -- Hardware SPI MISO = GPIO12 (not used) - -- CS and D/C can be assigned freely to available GPIOs - cs = 8 -- GPIO15, pull-down 10k to GND - dc = 4 -- GPIO2 + -- CS, D/C, and RES can be assigned freely to available GPIOs + cs = 8 -- GPIO15, pull-down 10k to GND + dc = 4 -- GPIO2 + res = 0 -- GPIO16 spi.setup(1, spi.MASTER, spi.CPOL_LOW, spi.CPHA_LOW, spi.DATABITS_8, 0) - disp = u8g.ssd1306_128x64_spi(cs, dc) + disp = u8g.ssd1306_128x64_spi(cs, dc, res) end