The purpose of this lab was to create video game on p5 with an Arduino game controller. In order to have Arduino talk to p5 and work as a game controller, we utilized serial communication which is a new topic we learned in this lab. We also got to practice analog input and learned how to use smoothing code to make our potentiometers less noisy.
The first step of this lab was ideating a game concept. I first thought about the kind of controller I wanted to build and then came up with a game that would be intuitive based off the controller. I chose to use 3 different potentiometers as my controller. From my game I created a color matching game, in which you are shown a color and must match it by spinning the red, green, and blue potentiometers.
The controller I created was a simple analog input controller with 3 potentiometers. For this circuit, I did not need any physical output because the output is represented virtually on p5. I had never created a circuit without output before and relied on the serial monitor to make sure I was collecting the right information. Because I was using externally wired potentiometers that couldn't plug directly into the breadboard, I glued them down to cardboard to keep my circuit organized and easy to use.
The materials I used to build this circuit are as follows:
The schematic for this circuit is very simple because it only has analog input sensors (the potentiometers) and all of the output is controlled virtually with the serial monitor on p5.