Hey all! I am working with some students to create a camera display that triggers effects on the push of a few buttons. I can get the preview to work with effects using the raspberrypi.org getting started with picam tutorial. I can also get the button to trigger the preview using the gpiozero documentation. I cannot get the button to trigger an effect by attempting to combine the two.
Here is the code that isn't working.
Code: Select all
from gpiozero import Button
from picamera import PiCamera
from time import sleep
left_button = Button(3)
camera = PiCamera()
left_button.when_pressed = camera.image_effect = 'colorswap'
I assume there is a problem with line 7 using two equal signs. Anyone see a fix for me?