RP2-Dual-Display

240x240 GC9A01 display connected to a Raspberry Pi Pico.

Connections

Pico Pin

Display

27 (GP21)

BL

26 (GP20)

RST

21 (GP16)

DC

22 (GP17)

CS

23 (GND)

GND

24 (GP18)

CLK

25 (GP19)

DIN

tft_configs/RP2-Dual-Display/tft_config0.py

 1"""tft0 of dual 240x240 GC9A01
 2
 3240x240 GC9A01 display connected to a Raspberry Pi Pico.
 4
 5.. list-table:: **Connections**
 6  :header-rows: 1
 7
 8  * - Pico Pin
 9    - Display
10  * - 27 (GP21)
11    - BL
12  * - 26 (GP20)
13    - RST
14  * - 21 (GP16)
15    - DC
16  * - 22 (GP17)
17    - CS
18  * - 23 (GND)
19    - GND
20  * - 24 (GP18)
21    - CLK
22  * - 25 (GP19)
23    - DIN
24"""
25
26from machine import Pin, SPI
27import gc9a01
28
29TFA = 0
30BFA = 0
31WIDE = 1
32TALL = 0
33
34
35def config(rotation=0, buffer_size=0, options=0):
36    """Configure the display and return an instance of gc9a01.GC9A01."""
37    spi0 = SPI(0, baudrate=60000000, sck=Pin(18), mosi=Pin(19))
38    tft0 = gc9a01.GC9A01(
39        spi0,
40        240,
41        240,
42        reset=Pin(20, Pin.OUT),
43        cs=Pin(17, Pin.OUT),
44        dc=Pin(16, Pin.OUT),
45        backlight=Pin(21, Pin.OUT),
46        rotation=rotation,
47        options=options,
48        buffer_size=buffer_size,
49    )

240x240 GC9A01 display connected to a Raspberry Pi Pico.

Connections

Pico Pin

Display

14 (GP10)

BL

15 (GP11)

RST

16 (GP12)

DC

17 (GP13)

CS

18 (GND)

GND

19 (GP14)

CLK

20 (GP15)

DIN

tft_configs/RP2-Dual-Display/tft_config1.py

 1"""tft1 of dual 240x240 GC9A01
 2
 3240x240 GC9A01 display connected to a Raspberry Pi Pico.
 4
 5.. list-table:: **Connections**
 6  :header-rows: 1
 7
 8  * - Pico Pin
 9    - Display
10  * - 14 (GP10)
11    - BL
12  * - 15 (GP11)
13    - RST
14  * - 16 (GP12)
15    - DC
16  * - 17 (GP13)
17    - CS
18  * - 18 (GND)
19    - GND
20  * - 19 (GP14)
21    - CLK
22  * - 20 (GP15)
23    - DIN
24"""
25
26from machine import Pin, SPI
27import gc9a01
28
29TFA = 0
30BFA = 0
31WIDE = 1
32TALL = 0
33
34
35def config(rotation=0, buffer_size=0, options=0):
36    """Configure the display and return an instance of gc9a01.GC9A01."""
37    spi1 = SPI(1, baudrate=60000000, sck=Pin(14), mosi=Pin(15))
38    tft1 = gc9a01.GC9A01(
39        spi1,
40        240,
41        240,
42        reset=Pin(11, Pin.OUT),
43        cs=Pin(13, Pin.OUT),
44        dc=Pin(12, Pin.OUT),
45        backlight=Pin(10, Pin.OUT),
46        rotation=rotation,
47        options=options,
48        buffer_size=buffer_size,
49    )

tft_configs/RP2-Dual-Display/tft_buttons.py

 1"""Dual Display RP2040 Buttons
 2"""
 3
 4from machine import Pin
 5
 6
 7class Buttons:
 8    """Buttons class."""
 9
10    def __init__(self):
11        self.name = "RP2040-Touch-LCD-1.28"
12        self.left = 0
13        self.right = 0
14        self.hyper = 0
15        self.thrust = 0
16        self.fire = 0