During Recitation
Our recitations always surprise me with more and more fancy techniques to be learnt, so does my experience with sensors.
Firstly, we built a Joy Stick circuit.
We connect the Joy Stick to our servo, then we can use the stick to control the movement of the it. I thought the programming of it can be much similar to the code when we use the variable resister to control the servo, so I use the code from servo: knob for reference.
Following is the code:
#include <Servo.h> Servo myservo; // create servo object to control a servo int potpin = 0; // analog pin used to connect the potentiometer int val; // variable to read the value from the analog pin void setup() { myservo.attach(9); // attaches the servo on pin 9 to the servo object } void loop() { val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023) val = map(val, 0, 1023, 0, 180); // scale it to use it with the servo (value between 0 and 180) myservo.write(val); // sets the servo position according to the scaled value delay(15); // waits for the servo to get there } And the Graph:
Then in the extra time we tried the second sensor: Infrared Distance Sensor. I tried to make it be able to control the brightness of the LED. Still, the core of the coding part is similar to using the variable resister to control the servo in 7th lecture.
The code is as followed:
int val = 1; // a variable void setup() { pinMode(9, OUTPUT); } void loop() { val = analogRead(1); analogWrite(9, val / 4); }
Answers for Document Questions
Question 1: What did you intend to assemble in the recitation exercise? If your sensor/actuator combination were to be used for pragmatic purposes, who would use it, why would they use it, and how could it be used?
I’ve assembled sensors with LED and servo. When I connected infrared distance sensor with LED, I think it can be made into a secure system. As people step closer to the sensor, the lights grow brighter to call the owner’s attention. It can be used by people living along or the secure system of museums. Also, when the joystick and servo is combined, it can be used as a part of model helicopter or submarine, then the models can be controlled by child or other owners.
Question 2: Code is often compared to following a recipe or tutorial. Why do you think that is?
There are fixed grammar and format for code, so coding is just like following recipe. And also, there’ve been many excellent coding examples released in open source platform like Arduino, which are well-designed and easy to access, saving a bunch of time struggling with code and bugs, so that it’s easy to literarily following a tutorial. However, code is just like the language of computer, and its charm largely lies in the process in which you try to communicate with your device, and that’s what totally beyond following a recipe.
Question 3: In Language of New Media, Manovich describes the influence of computers on new media. In what ways do you believe the computer influences our human behaviors?
Computer, as an extremely convenient devices, has made human spend more and more time on dealing with staff on computer, and that finally reduce the time we spent in real life experience and face to face conversation. So I think computer influences our behaviors by cutting into people’s connection, being the medium of people’s work and communicate by force. So that we’re more and more relying on life with computer, because once we stop using it, all the connection between ourselves with friends and works will be cut off.