mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2025-10-29 17:50:37 +00:00
Fix Travis-build Recipe
Swap tabs to spaces, and use gpiozero.tools.negated
This commit is contained in:
@@ -196,7 +196,7 @@ Button controlled camera
|
||||
========================
|
||||
|
||||
Using the button press to trigger picamera to take a pitcure using
|
||||
``button.when_pressed = camera.capture`` would not work because it requires an
|
||||
``button/when_pressed = camera.capture`` would not work because it requires an
|
||||
``output`` parameter. However, this can be achieved using a custom function
|
||||
which requires no parameters::
|
||||
|
||||
@@ -328,6 +328,7 @@ tests are passing, a red light means the build is broken::
|
||||
|
||||
from travispy import TravisPy
|
||||
from gpiozero import LED
|
||||
from gpiozero.tools import negated
|
||||
from time import sleep
|
||||
from signal import pause
|
||||
|
||||
@@ -338,14 +339,10 @@ tests are passing, a red light means the build is broken::
|
||||
yield r.last_build_state == 'passed'
|
||||
sleep(delay) # Sleep an hour before hitting travis again
|
||||
|
||||
def invert(values):
|
||||
for value in values:
|
||||
yield not value
|
||||
|
||||
red = LED(12)
|
||||
green = LED(16)
|
||||
|
||||
red.source = invert(green.values)
|
||||
red.source = negated(green.values)
|
||||
green.source = build_passed()
|
||||
pause()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user