The Creation of a 1T Pong Game Using Arduino and LEDs
As an electronics enthusiast, I embarked on an exciting project to create a 1T pong game using Arduino and LEDs. The journey began with designing the layout of the LED matrices and figuring out how to connect them to the Arduino board.
Firstly, I placed two holes in front of the first LEDs and another hole in front of the longer LED strip after removing the insulation of three more cables. I pushed them through the holes from the bottom and so that the brown wire is 2.5V, the blue wire is connected to the data pins, and the black wire is connected to ground. As soon as I added some hot glue for strain relief, it was time to connect the 5V and ground wires to one Breadboard terminal each and the data in wires to pin 10, 9, and 8 of the Arduino.
I then hooked up the ground potential to the microcontroller, connected debugger terminals to fight for power which did not led to an explosion brilliant. I added ground potential to the microcontroller hooked up debugger terminals to fight for power which did not lead to an explosion, brilliant and quickly programmed the microcontroller in order to see whether all LEDs would function correctly.
The game's rules were declared - a light dot travels from left to right and right to left, and the players have to hit a button at a precise moment to bounce the ball back. The last five LEDs of each strip and light of Reds the previous five LEDs will light up yellow and the rest green. The speed of the dots movements will also increase with every successful counter of a player.
I created 10 numbers for the scoreboards as you can see here I stood whole bunch of numbers in a race which are not just random but represent the LED enumeration that need to light up in order to form the desired number through the help of the fast LED librarian it was actually pretty simple to light up the required LEDs in the array which as you can see work without any problems on the LED matrix.
The actual game codes were written using a variable called Game States to create four states of the game. The first one is when the game puts up but not starts yet. The second one is for when either the red or green button is pushed and the game starts. The third one is for when the green pea has to bounce back the dots. The fourth one is for when the red player has to bounce the dot back.
I utilized an external interrupt for the push buttons so that the game can react immediately when they're getting pressed. I also monitored the power consumption which never exceeded 1.5 amps which means that I got myself a five-fold three and power supply hooked up the Arduino to the Vargo terminals edit a DC jack to the whole wiring and powered the whole system to that power supply.
Lastly, I mounted the Arduino Vargo terminals and DC jack onto the bottom of the game boards with zip ties. With that being done, my 1T pong game was complete, and it's surely a ton of fun to play with friends. I hope you enjoyed this project, and maybe even give it a try yourself if so don't forget to Like share and subscribe stay creative and I will see you next time
WEBVTTKind: captionsLanguage: enever dreamed of creating your own classical pong game well you came to the right place because in this video I will firstly be showing you how I created a simple game board from a couple pieces of woods to which either mounted all the mandatory electronics components for such a game Midway I will then demonstrate how easy a-slash difficult it actually is to program such one-dimensional pong game from scratch and at the end I will tidy up the wiring so that we can enjoy some really fun to play competitive 1d pong let's get started this video is sponsored by jl CPC be one fact about them you can get 24 hour quick turn SMT stencils for only seven dollars per piece use high-quality stencils to simplify the sampling process of your PCBs to start off I got myself an MDF ports with dimensions of 800 by 480 millimeters and marked two Italian opposing corners on the boards with a distance of 5 centimeters from the edges I needed those markings for the two oversized push buttons aka buzzer buttons which I aligned along the drawn lines after removing the top ports I used 2 4 millimeter drill to firstly mark their four mounting holes and then created them in the MDF boards next I grabbed the longer augments of solid woods move dimensions of 100 by 43 millimeters and marked eight pieces with a length of 70 millimeters on to it through the help of a circular saw I then created the required eight pieces which were certainly not perfect but good enough for my crude game boards so I gathered a couple of leftover wood screws I had laying around and utilized a bit of superglue to temporarily secure the eight wouldn't standoffs to the underside of the board's like it's shown in this plan once the glue was dry I flip the board over and noticed that the middle section of its was not stable enough yet to fix that I mocked the center of the board on its underside created another standoff and mounted eights who have super glue as well after once again flipping the board over I marked four spots in each corner of the board whose exact location you can also find in the plans for this project next I got a nine millimeter drill to create small indentations in the markings so that the utilized wood screws for the permanent mounting of the standoffs can sit flush with the surface and as soon as all wood screws were driven into the MDF boards and the standoffs which includes the centre stand up as well the game board was basically complete to make it look a bit more appealing though I used some white spray paints to cover the front and back sides once that was dry I grabbed eight and four truce over length of 25 millimeters which I used in combination with self-locking nuts to permanently secure the base of the big push buttons to the boards now for the Y ring I used two solids for wire conductor cable which features a diameter of roughly five millimeters so I grabbed a five millimeter drill and created a hole for the cable in each base of the buttons after then cutting two lengths of the cable I removed their insulation snipped off the yellow and blue wire removed the insulation of the brown and black wire and connected the two wires to the green switch of the two push buttons which is the normally open switch then I guided the cables through the base holes and finally closed up the buzzers and once I was done with my press tests which let's face it is always awesome with such buzzers it was time to move on to the LEDs I used ws2812 be a addressable RGB LEDs for which I firstly marked a horizontal center line onto the game boards and after counting up to exactly 40 LEDs on the strip I cut its removed the protective film of its back sides and secured it with it's given adhesive onto the center line but since the adhesive is honestly not the best I added a bit more hot glue under the strip just to be on the safe side afterwards I cut six smaller strips which featured five LEDs each for which among two spots five centimeter in front of the two buzzers according to the middle of the button I then positioned the first LED strip and afterwards the other two left and right from its butt make sure that the orientation of the data lines look something like this otherwise we will make the programming harder for us later on anyway once I repeated this LED mounting procedure for the other push buttons I used a bit of hot glue on all the LED strips ends and then used a bit of the previously utilized wire to connect the three individual strips into one longest trip according to the scheme and speaking of schemes and plans and schematics and whatnots you can of course get them for this project in the video description ok moving on once I was done with the scoreboard LED strips I jeweled a 5 millimeter hole in front of the first LEDs and also another hole in front of the longer LED strip after then removing the insulation of three more cables I pushed them through the holes from the bottom and so that the brown wire is 2 5 foods the blue virus to the data in pins and the black wire to ground and as soon as I added some hot glue for strain relief it was time to connect the 5 volts and ground wires to one Baco terminal each and the data in wires to the pin 10 9 and 8 of not we know Nano then I added the ground potential to the microcontroller hooked up debugger terminals to fight for power which did not led to an explosion brilliant and quickly programmed the microcontroller in order to see whether all LEDs would function correctly which they did so last but not least for the electronics wire ring I soldered the push-button wires to the pin 3 and tool of the Arduino and connected the remaining wire to the ground terminal and with that step being completed it was time for programming which means I had to firstly declare the rules of my pong game what I want is that a light dots travels from left to right and right to left and the players have to hit a button at a precise moment to bounce the ball back this moment will be when the last five LEDs of each strips and light of Reds the previous five LEDs will light up yellow and the rest green the speed of the dots movements will also increase with every successful counter of a player which will make the game incrementally harder a player will score one point if the enemy pushes the button too year or too late and the following serf then goes to the loser this course will be displayed by the two LED matrices above the push buttons and as soon as one player reaches 10 points I want a small wind animation before the whole game resets and with the rules being established it was time to write the codes for which I started with the creation of the 10 numbers for the scoreboards as you can see here I stood whole bunch of numbers in a race which are not just random but represent the LED enumeration that need to light up in order to form the desired number and through the help of the fast LED librarian it was actually pretty simple to light up the required LEDs in the array which as you can see work without any problems on the LED matrix so it was time to write the actual game codes which was certainly not that easier and took me around 4 to 5 hours generally speaking I used the variable called game States to create the four states of the game the first one is when the game puts up but not starts yet the second one is for when either the red or green button is pushed and the game starts the third one is for when the green pea has to bounce back the dots the fourth one is for when the red player has to bounce the dot back and the fifth one is for when somebody scores during those game states I created a whole lot of long functions which might look terrible to advanced programmers but for me I'm just happy that the game worked in the end also I utilized an external interrupt for the push buttons so that the game can react immediately when they're getting pressed but if you want to learn more about the codes I would highly recommend downloading it and going through it line by line anyway after uploading the final codes to the arduino i did a test match with myself which as you can see you work without a problem the LED colors worked the bounce detection works the increasing speed works these quarters play works and last but not least lee hwon animation worked as well while playing I also monitored the power consumption which never exceeded 1.5 amps which means that I got myself a five-fold 3 and power supply hooked up the Arduino to the Vargo terminals edit a DC jack to the whole wiring and powered the whole system to that power supply last but not least I mounted the Arduino Vargo terminals and DC jack onto the bottom of the game boards with zip ties and with that being done my 1t pong game was complete and it's surely a ton of fun to play with friends I hope you enjoyed this project and maybe even give it a try yourself if so don't forget to Like share and subscribe stay creative and I will see you next timeever dreamed of creating your own classical pong game well you came to the right place because in this video I will firstly be showing you how I created a simple game board from a couple pieces of woods to which either mounted all the mandatory electronics components for such a game Midway I will then demonstrate how easy a-slash difficult it actually is to program such one-dimensional pong game from scratch and at the end I will tidy up the wiring so that we can enjoy some really fun to play competitive 1d pong let's get started this video is sponsored by jl CPC be one fact about them you can get 24 hour quick turn SMT stencils for only seven dollars per piece use high-quality stencils to simplify the sampling process of your PCBs to start off I got myself an MDF ports with dimensions of 800 by 480 millimeters and marked two Italian opposing corners on the boards with a distance of 5 centimeters from the edges I needed those markings for the two oversized push buttons aka buzzer buttons which I aligned along the drawn lines after removing the top ports I used 2 4 millimeter drill to firstly mark their four mounting holes and then created them in the MDF boards next I grabbed the longer augments of solid woods move dimensions of 100 by 43 millimeters and marked eight pieces with a length of 70 millimeters on to it through the help of a circular saw I then created the required eight pieces which were certainly not perfect but good enough for my crude game boards so I gathered a couple of leftover wood screws I had laying around and utilized a bit of superglue to temporarily secure the eight wouldn't standoffs to the underside of the board's like it's shown in this plan once the glue was dry I flip the board over and noticed that the middle section of its was not stable enough yet to fix that I mocked the center of the board on its underside created another standoff and mounted eights who have super glue as well after once again flipping the board over I marked four spots in each corner of the board whose exact location you can also find in the plans for this project next I got a nine millimeter drill to create small indentations in the markings so that the utilized wood screws for the permanent mounting of the standoffs can sit flush with the surface and as soon as all wood screws were driven into the MDF boards and the standoffs which includes the centre stand up as well the game board was basically complete to make it look a bit more appealing though I used some white spray paints to cover the front and back sides once that was dry I grabbed eight and four truce over length of 25 millimeters which I used in combination with self-locking nuts to permanently secure the base of the big push buttons to the boards now for the Y ring I used two solids for wire conductor cable which features a diameter of roughly five millimeters so I grabbed a five millimeter drill and created a hole for the cable in each base of the buttons after then cutting two lengths of the cable I removed their insulation snipped off the yellow and blue wire removed the insulation of the brown and black wire and connected the two wires to the green switch of the two push buttons which is the normally open switch then I guided the cables through the base holes and finally closed up the buzzers and once I was done with my press tests which let's face it is always awesome with such buzzers it was time to move on to the LEDs I used ws2812 be a addressable RGB LEDs for which I firstly marked a horizontal center line onto the game boards and after counting up to exactly 40 LEDs on the strip I cut its removed the protective film of its back sides and secured it with it's given adhesive onto the center line but since the adhesive is honestly not the best I added a bit more hot glue under the strip just to be on the safe side afterwards I cut six smaller strips which featured five LEDs each for which among two spots five centimeter in front of the two buzzers according to the middle of the button I then positioned the first LED strip and afterwards the other two left and right from its butt make sure that the orientation of the data lines look something like this otherwise we will make the programming harder for us later on anyway once I repeated this LED mounting procedure for the other push buttons I used a bit of hot glue on all the LED strips ends and then used a bit of the previously utilized wire to connect the three individual strips into one longest trip according to the scheme and speaking of schemes and plans and schematics and whatnots you can of course get them for this project in the video description ok moving on once I was done with the scoreboard LED strips I jeweled a 5 millimeter hole in front of the first LEDs and also another hole in front of the longer LED strip after then removing the insulation of three more cables I pushed them through the holes from the bottom and so that the brown wire is 2 5 foods the blue virus to the data in pins and the black wire to ground and as soon as I added some hot glue for strain relief it was time to connect the 5 volts and ground wires to one Baco terminal each and the data in wires to the pin 10 9 and 8 of not we know Nano then I added the ground potential to the microcontroller hooked up debugger terminals to fight for power which did not led to an explosion brilliant and quickly programmed the microcontroller in order to see whether all LEDs would function correctly which they did so last but not least for the electronics wire ring I soldered the push-button wires to the pin 3 and tool of the Arduino and connected the remaining wire to the ground terminal and with that step being completed it was time for programming which means I had to firstly declare the rules of my pong game what I want is that a light dots travels from left to right and right to left and the players have to hit a button at a precise moment to bounce the ball back this moment will be when the last five LEDs of each strips and light of Reds the previous five LEDs will light up yellow and the rest green the speed of the dots movements will also increase with every successful counter of a player which will make the game incrementally harder a player will score one point if the enemy pushes the button too year or too late and the following serf then goes to the loser this course will be displayed by the two LED matrices above the push buttons and as soon as one player reaches 10 points I want a small wind animation before the whole game resets and with the rules being established it was time to write the codes for which I started with the creation of the 10 numbers for the scoreboards as you can see here I stood whole bunch of numbers in a race which are not just random but represent the LED enumeration that need to light up in order to form the desired number and through the help of the fast LED librarian it was actually pretty simple to light up the required LEDs in the array which as you can see work without any problems on the LED matrix so it was time to write the actual game codes which was certainly not that easier and took me around 4 to 5 hours generally speaking I used the variable called game States to create the four states of the game the first one is when the game puts up but not starts yet the second one is for when either the red or green button is pushed and the game starts the third one is for when the green pea has to bounce back the dots the fourth one is for when the red player has to bounce the dot back and the fifth one is for when somebody scores during those game states I created a whole lot of long functions which might look terrible to advanced programmers but for me I'm just happy that the game worked in the end also I utilized an external interrupt for the push buttons so that the game can react immediately when they're getting pressed but if you want to learn more about the codes I would highly recommend downloading it and going through it line by line anyway after uploading the final codes to the arduino i did a test match with myself which as you can see you work without a problem the LED colors worked the bounce detection works the increasing speed works these quarters play works and last but not least lee hwon animation worked as well while playing I also monitored the power consumption which never exceeded 1.5 amps which means that I got myself a five-fold 3 and power supply hooked up the Arduino to the Vargo terminals edit a DC jack to the whole wiring and powered the whole system to that power supply last but not least I mounted the Arduino Vargo terminals and DC jack onto the bottom of the game boards with zip ties and with that being done my 1t pong game was complete and it's surely a ton of fun to play with friends I hope you enjoyed this project and maybe even give it a try yourself if so don't forget to Like share and subscribe stay creative and I will see you next time