Tasks
- Exercise 1: Make a Processing Etch a Sketch
Schematic
Video
Process
The first step: building the circuit was easy for me because we had done the same thing in class. And I could also remember the first part of the processing code, which requires us to connect Arduino and Processing using int function and change number of values in both codes. The first video was to check if I connect the two potentiometers rightly via serial monitor in Arduino. After finishing these simple steps, the problem came to me that I didn’t know how to “write a Processing sketch that draws an ellipse and reads those two analog values from Arduino”. I could remember we’ve drawn a similar circle in class, but I didn’t save the code, and my memory became vague. So I asked an assistant for help. When he mentioned “1023”, I suddenly thought about the map function, and he also helped type in the first line, so I could emulate it and finish the rest line myself. I’m so glad that it finally worked!
Code
- Exercise 2: Make a musical instrument with Arduino
Schematic
Video
Process
The circuit part was even easier than the first one, and I did the part I could do like in exercise one. But still, when it came to the most important part, my mind was empty. This time another assistant came to my help, but she only gave a little hint and helped us finish the Arduino code. So I stared at the Processing code and suddenly it hit me and I wrote down “int values[0]= mouseX; int
values[1]= mouseY;” in “void draw”, well, error message. Then I deleted the two “int”s intuitively and surprisingly it worked! I really appreciate my intuition but I think I should also make an effort to really understand those codes, so I can write them and know the effect of every little change I make in codes.
Code