Saturday, February 4, 2012

Arduino - Blinking LED

I have been playing with the arduino and followed simple steps to come up with my first blinking LED program. This is a simple example of blinking LED using Arduino. It is like first code example "Hello World" for beginners. We can also use the in-built small LED on the board itself for this experiment.



Hardware:

Arudino Duemilanove
2 pin LED
USB Power cord

Language:
Arduino programming language (based on Wiring) 

Environment:
Processing

How it works: 
As soon as you compile the codes with connected power cord and the LED will start blinking continuously.

Source Code:
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly. This example code is in the public domain.
*/

void setup() { // initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);

}
void loop() {
digitalWrite(13, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(1000); // wait for a second
}

Port:
Attach the long leg of an 2 pin LED (the positive leg, called the anode) to the "resistor" (to prevent blowing off LED). Attach the short leg (the negative leg, called the cathode) to ground.


Enjoy :)

Saturday, January 7, 2012

Arduino Final Prototype - Augmented 'Egg and Spoon' race


This is a sample video of my final prototype for a module in Msc Interaction Design. This was an opportunity to design a low-fi prototype away from traditional desktop learning. The prototype simulates the "egg and spoon" game for children with the support of easy to use arduino technology.



Hardware:
Arudino Duemilanove
5mm Flux RGB LED Piranha (four pin)
Accelerometer
Breadboard
Axial-lead resistors
Spaghetti wires
USB Power cord

Language:
Arduino programming language (based on Wiring)

Environment:
Processing

How it works:
The egg and spoon game is simulated using arduino technology with accelerometer and LED. The breadboard can be identified as spoon and LED as egg. The four pin piranha LED indicates the different states of the egg. For example: green colour means egg is fine, yellow colour means egg is about to fall and red colour indicates egg as fallen and you lose.

The LED changes its colour depending on the position of the spoon and in this case breadboard. If the board is parallel to the ground then the LED colour remains green showing the egg is properly on the spoon ans the player can keep running to the finish line.

If the breadboard is tilted to some degree the colour of the LED will start changing towards yellow colour and if its tilted more then it will get deep red colour indicating that egg has fallen down and the game is over.

Codes:
You can email me at kishan[at]designimpacts.com for more information and for the codes please do state the purpose.