use RES pin for examples
This commit is contained in:
parent
09b650be41
commit
b34a8b46fe
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue