• Skip to main content
  • Skip to primary sidebar

alaia's ima doc

Just another Web Publishing @ NYU site

Oct 06 2022

recitation 2

In our second recitation, we built three different circuits and ran them with code to practice our use of Arduino. 

 

1st circuit 

\/*
Fade

This example shows how to fade an LED on pin 9 using the analogWrite()
function.

The analogWrite() function uses PWM, so if you want to change the pin you're
using, be sure to use another PWM capable pin. On most Arduino, the PWM pins
are identified with a "~" sign, like ~3, ~5, ~6, ~9, ~10 and ~11.

This example code is in the public domain.

https://www.arduino.cc/en/Tutorial/BuiltInExamples/Fade
*/

int led = 9; // the PWM pin the LED is attached to
int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by

// the setup routine runs once when you press reset:
void setup() {
// declare pin 9 to be an output:
pinMode(led, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
// set the brightness of pin 9:
analogWrite(led, brightness);

// change the brightness for next time through the loop:
brightness = brightness + fadeAmount;

// reverse the direction of the fading at the ends of the fade:
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}
// wait for 30 milliseconds to see the dimming effect
delay(30);
}

2nd circuit

/*
2
3 Melody
4
5 Plays a melody
6
7 circuit:
8
9 – 8 ohm speaker on digital pin 8
10
11 created 21 Jan 2010
12
13 modified 30 Aug 2011
14
15 by Tom Igoe
16
17 This example code is in the public domain.
18
19 http://www.arduino.cchttps://www.arduino.cc/en/Tutorial/Tone
20
21*/
22
23#include “pitches.h”
24
25// notes in the melody:
26int melody[] = {
27
28 NOTE_C4, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3, 0, NOTE_B3, NOTE_C4
29};
30
31// note durations: 4 = quarter note, 8 = eighth note, etc.:
32int noteDurations[] = {
33
34 4, 8, 8, 4, 4, 4, 4, 4
35};
36
37void setup() {
38
39 // iterate over the notes of the melody:
40
41 for (int thisNote = 0; thisNote < 8; thisNote++) {
42
43 // to calculate the note duration, take one second divided by the note type.
44
45 //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
46
47 int noteDuration = 1000 / noteDurations[thisNote];
48
49 tone(8, melody[thisNote], noteDuration);
50
51 // to distinguish the notes, set a minimum time between them.
52
53 // the note’s duration + 30% seems to work well:
54
55 int pauseBetweenNotes = noteDuration * 1.30;
56
57 delay(pauseBetweenNotes);
58
59 // stop the tone playing:
60
61 noTone(8);
62
63 }
64}
65
66void loop() {
67
68 // no need to repeat the melody.
69}
https://wp.nyu.edu/gallatin-alaiaaaa/wp-content/uploads/sites/25472/2022/10/Alaia-2022-10-10-02.58.53.mp4
3rd circuit 
 
 

 

Question 1: Propose another kind of creative button you could use in Circuit 3 to make the game more interactive. Read and use some material from the Physical Computing, Introduction Chapter (p. xvii – p. xxix) to explain why this button would make this game more interactive.

The inspiration I got from the material is the quotation: We need to think about computers that sense more of your body, serve you in more places, and convey physical expression in addition to information. (2, Tom Igoe). While making the third circuit, I was always wondering if the technology can create interaction OR if our body movement provides technology a new sense of mission that express ourselves. To figure this out, I might replace the button with the AI installation that can compete with each other by computers. While two AI interact, we can temporarily neglect human body movement. However, this installation might lose its meaning of “competition” and make people lose the sense of fun while competing with other people. Therefore, I think interaction can be created between technologies; however, the computer will be more helpful to people when they join the interaction itself.

Question 2: Why did we use a 10 kOhm resistor with each push button? (Psssst… Go back to your slides for this answer)

Usually, variable resistors are used in electrical circuits. In this case, ohm refers to resistance. Tenk resistors are ideal for acting as pull-up/pull-down resistors for switches. Open switches connect the pin from the ground to the pin, so LOW indicates a voltage flow, while HIGH indicates a voltage flow. By doing this, I can ensure that the pin remains in a known state. As a result of the 220 resistor, there is a stronger current flowing from power to ground, which might cause the LED to blow.

Question 3: In the book Getting Started with Arduino there is a clear description about the “Arduino Way” in chapter 2. Find a project that you find interesting that can be used as an example for these kind of projects. Cite it in adequate manner, include a picture, and explain the reasons that you chose it.

As an electronic music producer, I’m impressed by Arduino’s fascinating ability to connect art and technology in an innovative way.

“I have always been fascinated by modularity and the ability to build complex systems by connect- ing together simple devices. This process is very well represented by Robert Moog and his ana- logue synthesizers. Musicians constructed sounds, trying endless combinations by patch- ing together different modules with cables. This approach made the synthesizer look like an old telephone switch, but combined with the numerous knobs, that was the perfect platform for tinkering with sound and innovating music. Moog described it as a process between “wit- nessing and discovering”. I’m sure most musi- cians at first didn’t know what all those hun- dreds of knobs did, but they tried and tried, refining their own style with no interruptions in the flow” (Banzi, 7).

—Massimo

 

While watching the video of Robert Moog performance with the synthesizer, I felt the electric devices could be used as a more creative form of art.

Written by Alaia Zhao · Categorized: Uncategorized

Primary Sidebar

Recent Posts

  • Individual project proposal
  • recitation 1
  • recitation 2
  • My definition of interaction
  • Group Research Project: Read

Recent Comments

  1. A WordPress Commenter on Hello world!

Archives

  • October 2022

Categories

  • Uncategorized