Andreas Demmelbauer преди 5 години
родител
ревизия
aa8780ba96
променени са 1 файла, в които са добавени 5 реда и са изтрити 5 реда
  1. +5
    -5
      Adafruit_Video_Looper/video_looper.py

+ 5
- 5
Adafruit_Video_Looper/video_looper.py Целия файл

@@ -91,7 +91,8 @@ class VideoLooper:
# Set GPIO Pin to input mode
if self._gpio_control:
wiringpi.pinMode(self._gpio_control_pin, 0)
wiringpi.wiringPiSetup()
wiringpi.pinMode(int(self._gpio_control_pin), 0)


def _print(self, message):
@@ -244,8 +245,7 @@ class VideoLooper:
self._prepare_to_run_playlist(playlist)
# Main loop to play videos in the playlist and listen for file changes.
while self._running:
if not self._gpio_control or wiringpi.digitalRead(self._gpio_control_pin) == self._gpio_control_upstate:
if not self._gpio_control or wiringpi.digitalRead(int(self._gpio_control_pin)) == int(self._gpio_control_upstate):
# Load and play a new movie if nothing is playing.
if not self._player.is_playing():
movie = playlist.get_next()
@@ -271,8 +271,8 @@ class VideoLooper:
else:
self._player.stop()
# Give the CPU some time to do other tasks.
time.sleep(0.002)
# Give the CPU some time to do other tasks.
time.sleep(0.1)

def quit(self):
"""Shut down the program"""


Зареждане…
Отказ
Запис