Learn how to create a video game and controller while learning basic programming, Algebra, Trigonometry, Cartesian graphing methods, Serial communication and analog sensor input. The skills and concepts covered in this activity are a great introduction to the same skills you would need to create embedded systems, graphical user interfaces and data logging technology, as well as work with robotics, GPS and more. But this way you’re creating a game that you can play with your friends in the process!
The Processing code (.pde files) runs on your computer and the Arduino code (.ino files) run on your microcontroller.
The instructions include a related Common Core Math standards list.
Important! Make sure you are using a 32 Bit version of Processing. Not sure what that means? Don’t worry, I outline it in the materials.
Arduino, Processing and written materials included in handy .zip files for download below.
Materials by Linz Craig.
Original code by Tom Igoe and Ben Leduc-Mills, expanded by Linz Craig
analog_pong01.ino – Arduino code for use with a single analog sensor.
analog_pong02.ino – Arduino code for use with two analog sensors.
Use analog_pong02.ino if you just want Pong up and running.
analog_pong2 _01.pde – Processing code for working through the accompanying handout.
analog_pong2 _01.pde is intended for use in the classroom and is non-functional without additions to the code as outlined in the handout.
analog_pong2 _02.pde – Processing code after working through the accompanying handout.
Use analog_pong2 _02.pde if you just want Pong up and running.