I have build a water drop rig that is supposed to trigger the camera shutter as soon as a water droplet breaks a laser beam. The event starts with the push of a button (PIN25IN) which in turn triggers a solenoid valve (PIN23OUT) that will release 1 or 2 droplets. (The time between the drops will be determined as I get the rig working). The 1st water drop will break a laser beam that will trigger a switch (PIN18IN) which will release the camera shutter (PIN8OUT).
Problem I am having with my script below is that the solenoid stays open for too long on drop number 2. This seems to be caused by the delay (sleep(0.5) I am trying to write in to have the camera shutter only trigger once.
Please look at my script below and advise why my GPIO8 delay will have an effect on my 2nd droplet timing on the solenoid valve.
GPIO25 - IN - Push-Button
GPIO23 - OUT - Solenoid Valve
GPIO18 - IN - Laser Water Drop Trigger
GPIO8 - OUT - Camera Shutter Release Cable
This is the script I m using:
I have the following script:
GPIO Pin 1: In
from time import sleep
import RPi.GPIO as GPIO
print'2 Drops Released'