This project is a fork of the P4wnP1_ALOA_OLED_MENU_V2 by BeBoXoS. It has been updated to Python 3 and modified for compatibility with the Waveshare 1.3inch LCD HAT for Raspberry Pi. More information about this LCD HAT is available here.
LCD Specifications:
Then run the following commands:
git clone https://github.com/NightRang3r/P4wnP1_ALOA_LCD_MENU.git
cd P4wnP1_ALOA_LCD_MENU
./install.sh
gui.py
file will likely be necessary.Display Driver Modification
Update the driver in gui.py
:
from luma.lcd.device import st7789 # Change to your display driver
Setting Display Dimensions
Configure the display width and height in gui.py
:
width = 240 # Change to your display width
height = 240 # Change to your display height
Pin Configuration
Adjust the PIN settings to match your LCD display:
RST = 27
CS = 8
DC = 25
# GPIO definition and LCD configuration
RST_PIN = 27 # Waveshare settings
CS_PIN = 8 # Waveshare settings
DC_PIN = 25 # Waveshare settings
KEY_UP_PIN = 6 # Stick up
KEY_DOWN_PIN = 19 # Stick down
KEY_LEFT_PIN = 5 # Stick left / go back
KEY_RIGHT_PIN = 26 # Stick right / go in / validate
KEY_PRESS_PIN = 13 # Stick center button
KEY1_PIN = 21 # Key 1 / up
KEY2_PIN = 20 # Key 2 / cancel/go back
KEY3_PIN = 16 # Key 3 / down
USER_I2C = 0 # Set to 1 if your OLED is I2C or 0 if using SPI interface
Adjusting Padding
Modify padding values if text is overlapping:
padding = -2
top = padding
bottom = height - padding
line1 = top
line2 = top + 20
line3 = top + 40
line4 = top + 60
line5 = top + 80
line6 = top + 100
line7 = top + 120
brightness = 255 # Max brightness
SPI Configuration
Update SPI settings and PINs:
serial = spi(device=0, port=0, gpio_DC=25, gpio_RST=27)
Splash Image Size Adjustment
Configure the display size for the splash image. You may need to resize the image in the image folder to match your display size:
device.width = 240
device.height = 240
c = (240 - 220) / 2
f = (240 - 350) / 2