Basic LCD + Button Control Guide

The W55MH32L-ADK features an on-board ST7789 color LCD display and on-board push buttons. This guide covers their pin assignments, hardware setup, and how to program them in MicroPython.
Under this page, you will find the code for using the the ST7789 and On-Board buttons of the board. If you need a detailed guide, please visit W55MH32L-ADK Reference.
Features
On-Board ST7789 Color LCD: Driven over SPI (
240x320resolution) with dedicated control pins for reset, data/command, chip select, and backlight.On-Board Tactile Buttons: Direct MCU GPIO inputs configured with pull-ups for responsive local control.
Ready-to-Use Prototyping Layout: All display and button signals are wired directly on the Application Kit board.
Pinout & Hardware Mapping
On-Board Buttons
The sample code maps each button to its corresponding MCU pin using internal pull-ups (Pin.PULL_UP), reading 0 when pressed (active-low):
Button |
MCU Pin |
Mode / Pull |
Pressed State |
|---|---|---|---|
UP |
|
|
|
DOWN |
|
|
|
LEFT |
|
|
|
RIGHT |
|
|
|
A |
|
|
|
B |
|
|
|
ST7789 Display
Display Signal |
MCU Pin / Bus |
Role |
|---|---|---|
SPI Bus |
|
Serial display data transfer |
Backlight ( |
|
Output ( |
Reset ( |
|
Display hardware reset |
Data/Command ( |
|
Selects command vs. pixel data |
Chip Select ( |
|
SPI slave select |
Platforms Supported
MicroPython |
|---|
|
Instructions
W55MH32L-ADK
USB Type-C Cable
Connect a USB Type-C cable from the WIZ-LINK Port on the W55MH32L-ADK to your PC.
Ensure the required display driver files (
st7789pyandvga2_8x8) are available on your MicroPython device.
Sample Code Demo
Software
We will be using Thonny IDE to run the code.
Open Thonny IDE on your PC.
Select the correct COM port for your board.
Set the interpreter to MicroPython (generic).
Refer to the WIZnet documentation page for more detailed instructions in the Basic Setup section.
MicroPython
import time
import machine
import st7789py as st7789
import vga2_8x8
# --- Display Setup ---
bl_pin = machine.Pin("PB1", machine.Pin.OUT)
bl_pin.value(1) # Set to 0 if your backlight is active-low
rst_pin = machine.Pin("PC5", machine.Pin.OUT)
dc_pin = machine.Pin("PB0", machine.Pin.OUT)
cs_pin = machine.Pin("PC4", machine.Pin.OUT)
spi = machine.SPI(1, baudrate=10_000_000, polarity=0, phase=0)
display = st7789.ST7789(
spi,
240,
320,
reset=rst_pin,
dc=dc_pin,
cs=cs_pin,
backlight=bl_pin,
rotation=0,
)
display.inversion_mode(True)
def show_message(title, detail="", bg_color=st7789.BLACK, fg_color=st7789.WHITE):
display.fill(bg_color)
display.text(vga2_8x8, title, 16, 40, fg_color, bg_color)
if detail:
display.text(vga2_8x8, detail, 16, 60, fg_color, bg_color)
# --- Button Setup ---
# Assumes active-low buttons (pin reads 0 when pressed) using internal pull-ups.
# If your buttons connect to 3.3V instead, change Pin.PULL_UP to Pin.PULL_DOWN
# and invert the pressed check (pin.value() == 1).
buttons = {
"UP": {
"pin": machine.Pin("PA8", machine.Pin.IN, machine.Pin.PULL_UP),
"title": "UP PRESSED",
"detail": "Moving UP...",
"bg": st7789.BLUE,
"fg": st7789.WHITE,
},
"DOWN": {
"pin": machine.Pin("PC7", machine.Pin.IN, machine.Pin.PULL_UP),
"title": "DOWN PRESSED",
"detail": "Moving DOWN...",
"bg": st7789.GREEN,
"fg": st7789.BLACK,
},
"LEFT": {
"pin": machine.Pin("PC6", machine.Pin.IN, machine.Pin.PULL_UP),
"title": "LEFT PRESSED",
"detail": "Moving LEFT...",
"bg": st7789.YELLOW,
"fg": st7789.BLACK,
},
"RIGHT": {
"pin": machine.Pin("PG8", machine.Pin.IN, machine.Pin.PULL_UP),
"title": "RIGHT PRESSED",
"detail": "Moving RIGHT...",
"bg": st7789.MAGENTA,
"fg": st7789.WHITE,
},
"A": {
"pin": machine.Pin("PF13", machine.Pin.IN, machine.Pin.PULL_UP),
"title": "BUTTON A",
"detail": "Action A triggered!",
"bg": st7789.RED,
"fg": st7789.WHITE,
},
"B": {
"pin": machine.Pin("PF11", machine.Pin.IN, machine.Pin.PULL_UP),
"title": "BUTTON B",
"detail": "Action B triggered!",
"bg": st7789.WHITE,
"fg": st7789.BLACK,
},
}
# --- Main Loop ---
show_message("READY", "Press any button...")
last_pressed = None
last_press_time = 0
debounce_ms = 180
while True:
now = time.ticks_ms()
pressed_now = None
for name, cfg in buttons.items():
if cfg["pin"].value() == 0: # Active-low pressed state
pressed_now = name
break
if pressed_now is not None:
if pressed_now != last_pressed or time.ticks_diff(now, last_press_time) > debounce_ms:
cfg = buttons[pressed_now]
show_message(cfg["title"], cfg["detail"], cfg["bg"], cfg["fg"])
last_pressed = pressed_now
last_press_time = now
else:
# Reset so pressing the same button again immediately registers
last_pressed = None
time.sleep_ms(20)

Schematic
Download: W55MH32L-ADK Schematics
