Exercise 1: Make a Processing Etch A Sketch
The goal of this exercise is to use two potentiometers in Arduino to control the movement of an ellipse in processing. To begin with, I first built my circuit on the breadboard.
After checking my circuit in the Arduino code, I started to revise the code given to us to fit this exercise. I had problems in the beginning that the original Arduino code included three inputs so I deleted one but made the code not work. Young helped me that I needed to follow the format. Then I fixed the code and ran it successfully.
Exercise 2: Make a musical instrument with Arduino
The goal of this exercise is to activate the buzzer through mouse or keyboard in Processing. I also first built my circuit which was the easiest.
After watching the example video, the first thing for me was to figure out the tone() function. So I tested this function separately in the Arduino with a buzzer in the beginning. When I knew how it works, I started to revise the original code. I used the same myPort.write() function in Processing. However, this time it includes many letters pointing to Arduino instead of only controlling two states of a LED.
I chose to use the keyboard because I think it is cool to glide it.
Processing Code:
Arduino Code: