Browse Source

set pullUpDown

master
Andreas Demmelbauer 5 years ago
parent
commit
723b641134
2 changed files with 5 additions and 3 deletions
  1. +3
    -1
      Adafruit_Video_Looper/video_looper.py
  2. +2
    -2
      video_looper.ini

+ 3
- 1
Adafruit_Video_Looper/video_looper.py View File

@@ -62,6 +62,7 @@ class VideoLooper:
self._gpio_control = self._config.getboolean('video_looper', 'gpio_control')
self._gpio_control_pin = self._config.get('video_looper', 'gpio_control_pin')
self._gpio_control_upstate = self._config.get('video_looper', 'gpio_control_upstate') # 1 or 0
self._gpio_control_pullUpDnControl = self._config.get('video_looper', 'gpio_control_pullUpDnControl')
# Parse string of 3 comma separated values like "255, 255, 255" into
# list of ints for colors.
self._bgcolor = list(map(int, self._config.get('video_looper', 'bgcolor')
@@ -92,8 +93,9 @@ class VideoLooper:
# Set GPIO Pin to input mode
if self._gpio_control:
wiringpi.wiringPiSetup()
# Set Read mode
wiringpi.pinMode(int(self._gpio_control_pin), 0)
wiringpi.pullUpDnControl(int(self._gpio_control_pin), int(self._gpio_control_pullUpDnControl))

def _print(self, message):
"""Print message to standard output if console output is enabled."""


+ 2
- 2
video_looper.ini View File

@@ -41,11 +41,11 @@ is_random = false
#keyboard_control = false
keyboard_control = true


# Play video only if GPIO Pin is up (or down).
gpio_control = true
gpio_control_pin = 4
gpio_control_pin = 1
gpio_control_upstate = 1
gpio_control_pullUpDnControl = 1

# Set the background to a custom image
# This image is displayed between movies


Loading…
Cancel
Save