Step 1 Refine Processing Sketch
Since this project is built on my former Processing project (a game, Bubble Burst), firstly, I need to refine the processing code to open up new variables to receive data from Arduino.
The key variable is the X position of the control bar (at the bottom of the screen).
Step 2 Set the port
To have processing communicating to Arduino, basically, we need to set these two thing to respond to a same port. I referred to this tutorial from Arduino’s official site.
Here my port in Arduino is the fifth, so in Processing, I also set the port to be the fifth.
Step 3 Test
Then I ran the Processing sketch to see whether the control bar in the game responds to the physical position.
- Test more to find the most suitable distance range. Map the data to the range
- Use 3D print to create a controller