Hey guys I was wondering if anyone could help me out with my program since I’m new at Arduino programming.
I have 4 targets on a hockey net. There is an LED beside each target and a vibration sensor on the back of each target.
So I have 4 outputs and 4 inputs.
The outputs are LEDs and the inputs are vibration sensors.
Pin 12 is the top left LED
Pin 11 is the top right LED
Pin 10 is the bottom left LED
Pin 9 is the bottom right LED
Pin 8 is the top left vibration sensor
Pin 7 is the top right vibration sensor
Pin 6 is the bottom left vibration sensor
Pin 5 is the bottom right vibration sensor
Here’s what I’m looking to do.
Have 1 output go high for 4 seconds and while that output is high have the Arduino read the associated sensor (ex. when pin 11 is high, read pin 7).
If the Arduino does not receive a signal from pin 7 within the 4 seconds then pin 11 goes low. After 11 goes low there is a 4 second break until the next output goes high (ex. pin 9 high, read pin 5). Now if the Arduino receives a signal on 5 while 9 is high I want 9 to go low and then another 4 second break until the next output goes high (ex. 10 high, read 6).
Conclusion: Have random output on pin 12-9 go high for 4 seconds and have Arduino read associated sensor for 4 seconds. If no signal is received then output goes low, and there is a 4 second break then another output goes high. If the signal is received from sensor while associated LED is on then turn LED off and begin 4 second break and program continues to cycle the LEDs.
Any help is greatly appreciated.