This article assumes you have CircuitPython and a basic understanding of the programming language, as well as the necessary hardware.
Nokia 5110 |
Pins |
Gnd |
Gnd |
Bl |
3V3 |
Vcc |
3V3 |
Clk |
18GP |
Dir |
19GP |
DC |
20GP |
CE |
16GP |
RST |
17GP |
After you've done all of this, the circuit should now work. To get it working you'll need this library:
adafruit_pcd8544.py
You may also need this file:
framebuf.py
And now, the simplest part, coding!
import board
import busio
import digitalio
import adafruit_pcd8544
import microcontroller
import time
spi = busio.SPI(clock=board.GP18, MOSI=board.GP19)
dc = digitalio.DigitalInOut(board.GP20)
cs = digitalio.DigitalInOut(board.GP16)
reset = digitalio.DigitalInOut(board.GP17)
display = adafruit_pcd8544.PCD8544(spi, dc, cs, reset)
display.bias = 2
display.contrast = 70
while True:
display.fill(0)
display.pixel(x,y,1) # the available functions are on the framebuf documentation
time.sleep(0.5)
display.show()
Additional file to get the text working:
font5x8.bin