From c9cc8cfd899cb2f3f43eec79cce41d438b88b0ab Mon Sep 17 00:00:00 2001 From: DJ Sundog Date: Tue, 21 Jul 2020 18:49:51 -0700 Subject: [PATCH] add DisplayOff script, which turns off backlight and then stops the display driver - running Soundslab will start it back up. --- DisplayOff.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 DisplayOff.py diff --git a/DisplayOff.py b/DisplayOff.py new file mode 100755 index 0000000..701c9d7 --- /dev/null +++ b/DisplayOff.py @@ -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