diff --git a/Adafruit_Video_Looper/video_looper.py b/Adafruit_Video_Looper/video_looper.py index 7bffa7c..7f63f1f 100644 --- a/Adafruit_Video_Looper/video_looper.py +++ b/Adafruit_Video_Looper/video_looper.py @@ -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.""" diff --git a/video_looper.ini b/video_looper.ini index 6d5f3c5..c55f5ff 100644 --- a/video_looper.ini +++ b/video_looper.ini @@ -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