pico_epaper_42_v2.py: Change default pin to match hardware.

pull/48/head
Peter Hinch 2024-07-22 14:22:14 +01:00
rodzic 3b6d265810
commit 7a354af87a
2 zmienionych plików z 8 dodań i 5 usunięć

Wyświetl plik

@ -34,6 +34,7 @@
# Waveshare URLs
# Main page: https://www.waveshare.com/pico-epaper-4.2.htm
# Wiki: https://www.waveshare.com/wiki/Pico-ePaper-4.2
# Another wiki: https://www.waveshare.com/wiki/4.2inch_e-Paper_Module_Manual#Introduction
# Code: https://github.com/waveshareteam/Pico_ePaper_Code/blob/main/python/Pico-ePaper-4.2_V2.py
from machine import Pin, SPI
@ -56,9 +57,8 @@ _EPD_WIDTH = const(400)
_BWIDTH = _EPD_WIDTH // 8
_EPD_HEIGHT = const(300)
_RST_PIN = 12
# changed default to 7, as this can be confusing on pico -- pin 8 for SPI1 is the Rx, which overrides DC pin if miso is set to none
_DC_PIN = 7
_RST_PIN = 12 # Pin defaults match wiring of Pico socket
_DC_PIN = 8
_CS_PIN = 9
_BUSY_PIN = 13

Wyświetl plik

@ -29,14 +29,16 @@
from machine import Pin, SPI, freq
import gc
from drivers.epaper.pico_epaper_42 import EPD as SSD
from drivers.epaper.pico_epaper_42 import EPD as SSD # V1
# from drivers.epaper.pico_epaper_42_V2 import EPD as SSD # V2
freq(250_000_000) # RP2 overclock
# Create and export an SSD instance
prst = Pin(9, Pin.OUT, value=1)
pcs = Pin(10, Pin.OUT, value=1)
pdc = Pin(8, Pin.OUT, value=0) # Arbitrary pins
busy = Pin(15, Pin.IN)
# Datasheet allows 10MHz
# V1 UC8176 datasheet allows 10MHz. V2: Waveshare code uses 4MHz
spi = SPI(0, sck=Pin(6), mosi=Pin(7), miso=Pin(4), baudrate=10_000_000)
gc.collect() # Precaution before instantiating framebuf
@ -45,6 +47,7 @@ gc.collect() # Precaution before instantiating framebuf
ssd = SSD(spi, pcs, pdc, prst, busy)
gc.collect()
from gui.core.ugui import Display, quiet
# quiet()
# Create and export a Display instance
# Define control buttons