nrf5/drivers: Updating examples in comment in oled ssd1305 object to use the draw module.
This commit is contained in:
parent
87e7ab8862
commit
d37d799204
@ -117,31 +117,33 @@ reset = Pin("A13", mode=Pin.OUT, pull=Pin.PULL_UP)
|
|||||||
dc = Pin("A12", mode=Pin.OUT, pull=Pin.PULL_UP)
|
dc = Pin("A12", mode=Pin.OUT, pull=Pin.PULL_UP)
|
||||||
spi = SPI(0, baudrate=8000000)
|
spi = SPI(0, baudrate=8000000)
|
||||||
d = SSD1305(128, 64, spi, cs, dc, reset)
|
d = SSD1305(128, 64, spi, cs, dc, reset)
|
||||||
d.text("Hello World!", 32, 32)
|
draw.text(d, "Hello World!", 32, 32)
|
||||||
d.show()
|
d.show()
|
||||||
|
|
||||||
Example for nrf52832 / pca10040:
|
Example for nrf52832 / pca10040:
|
||||||
|
|
||||||
from machine import Pin, SPI
|
from machine import Pin, SPI
|
||||||
from display import SSD1305
|
from display import SSD1305
|
||||||
|
import draw
|
||||||
cs = Pin("A13", mode=Pin.OUT, pull=Pin.PULL_UP)
|
cs = Pin("A13", mode=Pin.OUT, pull=Pin.PULL_UP)
|
||||||
reset = Pin("A12", mode=Pin.OUT, pull=Pin.PULL_UP)
|
reset = Pin("A12", mode=Pin.OUT, pull=Pin.PULL_UP)
|
||||||
dc = Pin("A11", mode=Pin.OUT, pull=Pin.PULL_UP)
|
dc = Pin("A11", mode=Pin.OUT, pull=Pin.PULL_UP)
|
||||||
spi = SPI(0, baudrate=8000000)
|
spi = SPI(0, baudrate=8000000)
|
||||||
d = SSD1305(128, 64, spi, cs, dc, reset)
|
d = SSD1305(128, 64, spi, cs, dc, reset)
|
||||||
d.text("Hello World!", 32, 32)
|
draw.text(d, "Hello World!", 32, 32)
|
||||||
d.show()
|
d.show()
|
||||||
|
|
||||||
Example for nrf52840 / pca10056:
|
Example for nrf52840 / pca10056:
|
||||||
|
|
||||||
from machine import Pin, SPI
|
from machine import Pin, SPI
|
||||||
from display import SSD1305
|
from display import SSD1305
|
||||||
|
import draw
|
||||||
cs = Pin("B3", mode=Pin.OUT, pull=Pin.PULL_UP)
|
cs = Pin("B3", mode=Pin.OUT, pull=Pin.PULL_UP)
|
||||||
reset = Pin("B2", mode=Pin.OUT, pull=Pin.PULL_UP)
|
reset = Pin("B2", mode=Pin.OUT, pull=Pin.PULL_UP)
|
||||||
dc = Pin("B1", mode=Pin.OUT, pull=Pin.PULL_UP)
|
dc = Pin("B1", mode=Pin.OUT, pull=Pin.PULL_UP)
|
||||||
spi = SPI(0, baudrate=8000000)
|
spi = SPI(0, baudrate=8000000)
|
||||||
d = SSD1305(128, 64, spi, cs, dc, reset)
|
d = SSD1305(128, 64, spi, cs, dc, reset)
|
||||||
d.text("Hello World!", 32, 32)
|
draw.text(d, "Hello World!", 32, 32)
|
||||||
d.show()
|
d.show()
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user