Hello,
On the “Pirate Audio: Headphone Amp for Raspberry Pi”, is it possible to turn the screen off completely (e.g., to save power, or to completely stop any light emission)?
Thanks!
Hello,
On the “Pirate Audio: Headphone Amp for Raspberry Pi”, is it possible to turn the screen off completely (e.g., to save power, or to completely stop any light emission)?
Thanks!
This command turns off the backlight:
disp.set_backlight(0)
assuming that
import ST7789
disp = ST7789.ST7789(...)
I solved it, with inspiration above as follows:
cat displayoff.py
from st7789 import ST7789
# Set your parameters
rotation = 0 # Change as needed
spi_port = 0
spi_chip_select_pin = 0
spi_data_command_pin = 23
backlight_pin = 13
spi_speed_mhz = 80 # Example speed, adjust as necessary
# Initialize the display
disp = ST7789(
rotation=rotation,
port=spi_port,
cs=spi_chip_select_pin,
dc=spi_data_command_pin,
backlight=backlight_pin,
spi_speed_hz=spi_speed_mhz * 1000000 # Convert MHz to Hz
)
# Begin communication with the display
disp.begin()
# Turn off the backlight
disp.set_backlight(0)
print("Backlight turned off.")