LAB- basic challenge

youtube video of it working: LAB-basic challenge.

For this project I first created a base of popsicle sticks. I then created the system where pressing the pushbutton would make the servo motor spin 90 degrees. I attached a popsicle stick arm and created a space for the ping pong ball to sit on the arm. I wanted to create a catapult that would launch the ping pong ball. I used a RFD77402 ToF sensor, which someone at microcenter reccomended, to sense when the ping pong ball was in the catapult. I mounted the distance sensor on a popsicle stick which was next to the bay where the ping pong ball would sit. I also set up a piezo capsule which would buzz when the distance sensor sensed something less than 100 mm away. I combined the code for both these systems into one system so that the I could drop the ping pong ball into the catapult, the distance sensor would sense it ,causing the buzzer to go off. Then I pressed the push button, causing the servo motor to rotate 90 degrees and launch the ping pong ball causing the buzzing to stop.