Firstly, we need to flash the firmware onto the Arduino. This will allow the button presses and joystick movement to be sent to processing for playing sound via the Serial port.
- Open up an Arduino sketch and then copy the following code into the sketch.
- Compile the code and upload.
- Open up the Serial Monitor to make sure commands are getting sent. Move the joystick and press buttons to see the command changes.
Use the code below to interpret the data received from the Arduino and transform it into musical sounds.
Run the code.
The code above opens a processing graphical interface that plots the frequency and amplitude of the sound played.
Modify the code so that the size of the circle changes with the sound amplitude.
Modify the code so that the color of the circle changes with the frequency.