I trying to use your exemple but my display not working ?? i find other example but not with micropython board.
sommeone can help me please. ??

Yes, but only after a new user has posted a few times. This is to protect against spambots.krzysiu wrote:...it is not possible to add photos in this forum ?...
Code: Select all
from machine import SPI, Pin
import pcd8544
# WiPy (on Exp board, SD and User-LED jumper have to be removed!)
#SPI = machine.SPI(0) # GP14 (CLK) + GP16 (MOSI->DIN), User-LED jumper removed!
#RST = machine.Pin('GP24')
#CE = machine.Pin('GP12')
#DC = machine.Pin('GP22')
#LIGHT = machine.Pin('GP23')
# PWR = directly from 3V3 pin of the WiPy
#SPI = pyb.SPI(1)
#RST = pyb.Pin('Y4')
#CE = pyb.Pin('Y5')
#DC = pyb.Pin('Y3')
#LIGHT = pyb.Pin('Y2')
#PWR = pyb.Pin('Y1')
#
spi = pyb.SPI(1)
spi.init(baudrate=8000000, polarity=0, phase=0)
cs = pyb.Pin('Y5')#Pin(2)
dc = pyb.Pin('Y3')#Pin(15)
rst = pyb.Pin('Y4')#Pin(0)
# backlight on
bl = pyb.Pin('Y2',pyb.Pin.OUT, value=1) #Pin(12, Pin.OUT, value=1)
lcd = pcd8544.PCD8544(spi, cs, dc, rst)
# test pattern (50% on)
lcd.data(bytearray([0x55, 0xAA] * 42 * 6))
......
Code: Select all
import pyb
from pyb import LED
from pyb import SPI #, Pin
import upcd8544 #pcd8544
##
# WiPy (on Exp board, SD and User-LED jumper have to be removed!)
#SPI = machine.SPI(0) # GP14 (CLK) + GP16 (MOSI->DIN), User-LED jumper removed!
#RST = machine.Pin('GP24')
#CE = machine.Pin('GP12')
#DC = machine.Pin('GP22')
#LIGHT = machine.Pin('GP23')
# PWR = directly from 3V3 pin of the WiPy
#SPI = pyb.SPI(1)
RST = pyb.Pin('Y4')
CE = pyb.Pin('Y5')
DC = pyb.Pin('Y3')
LIGHT = pyb.Pin('Y2')
PWR = pyb.Pin('Y1')
##
#spi = pyb.SPI(1)
#spi.init(baudrate=8000000, polarity=0, phase=0)
spi = SPI(1,SPI.MASTER,baudrate=8000000, polarity=0, phase=0)
cs = pyb.Pin('Y5')#Pin(2)
dc = pyb.Pin('Y3')#Pin(15)
rst = pyb.Pin('Y4')#Pin(0)
## backlight on
bl = pyb.Pin('Y2',pyb.Pin.OUT, value=1) #Pin(12, Pin.OUT, value=1)
#lcd = upcd8544.PCD8544(spi, cs, dc, rst)
lcd = upcd8544.PCD8544(spi, RST, CE, DC, LIGHT)
lcd.reset()
lcd.init()
# test pattern (50% on)
#lcd.data(bytearray([0x55, 0xAA] * 42 * 6))
led = LED(4) # for testing code
led.on()