Finalised Concept for the Project
My final project is a dual-player wheel controlled dance survival game that uses both Arduino and p5.js to create a physically interactive digital experience. A physical wheel attached to a rotary encoder or potentiometer acts as the primary input device. When the player rotates the wheel, the Arduino reads real-time angle data and sends it to p5, which controls the horizontal position of two characters represented by circles inside a circular arena.
Random obstacles fall from the top of the p5 canvas, and the player must rotate the wheel to move both characters and avoid collisions. If either character touches a falling object, the game ends
Arduino Program:
Inputs:
- Potentiometer: measures the angle of the physical wheel. Maps the analogue input to degree values.
- This value is sent to p5 via Serial.
Outputs:
- Red / Green LED- for the disco effect of lights. Activates according to the song beats
P5 Program:
-
- Draw two player circles on the arena perimeter or surface.
- Spawn falling objects at random intervals and positions.
- Detect collisions between objects and characters.
- Read wheel angle data from Arduino
- Smoothly rotate the two characters horizontally based on the mapped value.
- Track the best score
- Play a song in the background and send instructions to Arduino to light up LEDs according to the beats

