Recitation 8: Serial Communication by Qianyue Fan

Exercise 1: Make a Processing Etch A Sketch

Building this circuit requires the knowledge of using code to send values from Arduino to Processing. I started from the examples we learned in class and added the code according to the comments in the example code. I forgot how to connect the potentiometer, so I referred to previous recitations. The use of println() was quite important in Arduino for it would affect the form of the data sent to processing.

The user interacts with the project by turning the potentiometers with different angles to move the dot and create images, and adjust the speed and direction of drawing when seeing the feedback on the screen.

schematic:

picture:

video:

Arduino code:

Processing code:

Exercise 2: Make a musical instrument with Arduino

I attempted to design a relatively complicated interface and it took me some time to decide the parameters of rectangles as keys for the notes. After finishing the code, the buzzer still made no tunes, so I asked for help and realized that I should use the PWM pin as the output. Also, there was a part of the code which turned the signals into 1 and 0 that I forgot to delete. With all these problems solved, the circuit worked well.

The user interacts with the project by clicking different parts of the screen or typing on the keyboard to make tunes.

schematic:

picture:

video:

Arduino code:

Processing code:

  

Leave a Reply