Gamla ändringar
This commit is contained in:
12
cover.py
12
cover.py
@@ -1,8 +1,10 @@
|
||||
from PIL import Image
|
||||
import ST7789 as ST7789
|
||||
import RPi.GPIO as GPIO
|
||||
import urllib2 as urllib
|
||||
import requests
|
||||
import io
|
||||
import time
|
||||
|
||||
# My music server URL
|
||||
url = "http://192.168.0.114:6680/mopidy/rpc"
|
||||
@@ -36,6 +38,13 @@ HEIGHT = disp.height
|
||||
# Initialize display.
|
||||
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.
|
||||
print('Loading image: {}...'.format(image_file))
|
||||
image = Image.open(image_file)
|
||||
@@ -47,3 +56,6 @@ image = image.resize((WIDTH, HEIGHT))
|
||||
print('Drawing image')
|
||||
|
||||
disp.display(image)
|
||||
time.sleep(120)
|
||||
backlight.ChangeDutyCycle(1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user