Fix Travis-build Recipe

Swap tabs to spaces, and use gpiozero.tools.negated
This commit is contained in:
Andrew Scheller
2016-05-27 00:33:45 +01:00
parent 2bd1cbc749
commit bd219d9e59

View File

@@ -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()