Gamla ändringar

This commit is contained in:
2022-01-29 09:48:05 +00:00
parent d0c368ec33
commit 031910249b
2 changed files with 12 additions and 1 deletions

View File

@@ -1,8 +1,10 @@
from PIL import Image from PIL import Image
import ST7789 as ST7789 import ST7789 as ST7789
import RPi.GPIO as GPIO
import urllib2 as urllib import urllib2 as urllib
import requests import requests
import io import io
import time
# My music server URL # My music server URL
url = "http://192.168.0.114:6680/mopidy/rpc" url = "http://192.168.0.114:6680/mopidy/rpc"
@@ -36,6 +38,13 @@ HEIGHT = disp.height
# Initialize display. # Initialize display.
disp.begin() disp.begin()
# Setup to be able to change backlight
GPIO.setmode(GPIO.BCM)
GPIO.setup(13, GPIO.OUT)
backlight = GPIO.PWM(13, 500)
# Set max backlight
backlight.start(100)
# Load an image. # Load an image.
print('Loading image: {}...'.format(image_file)) print('Loading image: {}...'.format(image_file))
image = Image.open(image_file) image = Image.open(image_file)
@@ -47,3 +56,6 @@ image = image.resize((WIDTH, HEIGHT))
print('Drawing image') print('Drawing image')
disp.display(image) disp.display(image)
time.sleep(120)
backlight.ChangeDutyCycle(1)

View File

@@ -3,6 +3,5 @@
while [ "a" != "b" ] while [ "a" != "b" ]
do do
python cover.py python cover.py
sleep 30
mpc --host 192.168.0.114 -q idle player mpc --host 192.168.0.114 -q idle player
done done