Ver código fonte

dix gpio errors

master
Andreas Demmelbauer 5 anos atrás
pai
commit
aa8780ba96
1 arquivos alterados com 5 adições e 5 exclusões
  1. +5
    -5
      Adafruit_Video_Looper/video_looper.py

+ 5
- 5
Adafruit_Video_Looper/video_looper.py Ver arquivo

@@ -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"""


Carregando…
Cancelar
Salvar