How can I make my pi's take pictures at the same time whenever I push a button? I've connected GPIO pin 2 to my button and a ground pin to the other end of the button for every pi. This is how I've connected it.
These are my python codes for each Pi.
#!usr/bin/python from gpiozero import Button from time import sleep from picamera import PiCamera button = Button(2) camera = PiCamera() while True: button.wait_for_press() camera.start_preview() sleep(3) camera.stop_preview() camera.capture(‘imagex.jpg’)
What happens is, only one pi out of 5 pis are taking the picture. I'm trying to make all 5 take pictures at the same time.