Question: WRITE A C CODE FOR THIS PROGRAM We will be recreating the ping pong game in a digital form using Raspberry PI 3, LED lights,
WRITE A C CODE FOR THIS PROGRAM
We will be recreating the ping pong game in a digital form using Raspberry PI 3, LED lights, push buttons, and 7-segment displays. The ping pong ball and the paddles will be represented by LED lights. The LED lights will turn on and off as they move left to right (knight rider) showing the balls movement. There will be 5 LED lights used. The first LED light represents player 1 and the fifth LED light represents player 2. When player 1 serves the ball, the first push button will be pushed and the light will turn on from the first LED to the fifth LED. Once it reaches the fifth light, if player 2 pushes the second button on time, then the light must move back from the fifth LED light to the first LED. The process will keep continuing until someone doesnt push the push button on time. Whoever misses the ball, a point will be earned to the other player. When a point is earned, it will be displayed on the 7 segment display. There will be two 7 segment displays, one for each player. Whoever gets to 9 points first wins the game, and the program stops and resets.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
