In this week's workshop we explored what adding extra components to the Arduino can offer as an interface.
We were given some basic components (single core wires, potentiometer) and shown some basic code on how to read serial signals from the Arduino. Because resources were low, some of us worked in a group. We were then told to experiment with how the potentiometer changes the voltages of its output and told to think how this could be used. After completing the initial experiment, we started to think how the code could be influenced by the changing values of the potentiometer.
After some trial and error, and some studying of the example programs, we managed to edit the first simple piece of code we used as a test (a blinking LED), into a simple interactive artifact.
int potPin = 2; // select the input pin for the potentiometer
int ledPin = 13; // select the pin for the LED
int val = 0; // variable to store the value coming from the sensor
void setup() {
pinMode(ledPin, OUTPUT); // declare the ledPin as an OUTPUT
Serial.begin(9600);
}
void loop() {
val = analogRead(potPin); // read the value from the sensor
digitalWrite(ledPin, HIGH); // turn the ledPin on
delay(val+100); // stop the program for some time
digitalWrite(ledPin, LOW); // turn the ledPin off
delay(val+100); // stop the program for some time
Serial.println(val); //print value of the pin
}
This code only has an extra few lines in, but does so much more when the components are wired correctly.
Video of demonstration and explanation...
... and here are some pictures...


After undertaking this exercise, I feel I have a wider knowledge of what hardware, and physical presence interfaces have. I also have a better understanding on how interfaces cover every aspect of life, and not just in computer software or hardware.
It will be interesting to see what has been done using Arduino technology, and if there would be any limit to its implementations.
No comments:
Post a Comment