add DisplayOff script, which turns off backlight and then stops the display driver - running Soundslab will start it back up.

This commit is contained in:
Sundog Jones 2020-07-21 18:49:51 -07:00
parent c225dbd50b
commit c9cc8cfd89
1 changed files with 16 additions and 0 deletions

16
DisplayOff.py Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env python
from ST7789 import ST7789
SPI_SPEED_MHZ = 80
st7789 = ST7789(
rotation=90, # Needed to display the right way up on Pirate Audio
port=0, # SPI port
cs=1, # SPI port Chip-select channel
dc=9, # BCM pin used for data/command
backlight=13,
spi_speed_hz=SPI_SPEED_MHZ * 1000 * 1000
)
st7789.set_backlight(0)
st7789.command(0x28) # DISPOFF