The project was born from the idea of making an arduino shooting laser game You will need the following components:
- 4 servos
- 8x8 Display
- 4 leds
- 4 photoresistor
- Pwm controller
- Desire to have fun( optional)
Step 1: Step 1
I started connecting the servos and preparing a function that generated a random sequence, to up and down each servo. This function was activated by a click on the button.
Then connect the photoresistors to detect when the laser touched them and create an active variable, and reset if the servo, once up, passed 2 seconds down.
Once the 4 servos were down,all variable was reset.
Connect the buzzer and 1 second before secuence servos start, emit sound to alert player to be ready again.
Step 2: Step 2 - Final Prototype
- Connect the servos to the controller, and prepare the "pull" function so that it will be generated during x time. It included a variable total score that was updated every time that one of the variables of the photoresistors changed. These variables were only detected when the servo to which it corresponded was uploaded. Connect the display and the LEDs, and prepare a function to show the total score and turn on the leds of success, each time the laser touched the photoresistors