Lab: Game or Audio Controller

Arduino Side

Here is the basic setup of my breadboard. First I connected to the ground and power from the microcontroller and made sure it connected to the entirety of the board. Then I added the potentiometer and photocell to the breadboard. The potentiometer has signal, ground, and power. The signal of the potentiometer is connected to A2. Meanwhile, the photocell needs to be connected to the ground and power. Then the connection from the ground must connect to a signal and that is A0.

Schematic:

Code: https://github.com/Enovai/Object/blob/main/setup.ino

P5 Side

I chose to make a simple game where I can use the potentiometer to move the square and then the photocell to jump. The square has to move around and jump over the bars.

Codes:

Entire Files: https://github.com/Enovai/Object/blob/main/Object_Lab_2022_11_09_23_41_03.zip

Main File(The one I used to create my game):

https://github.com/Enovai/Object/blob/main/sketch.js