Physical Computing: Blink the LED

My first ITP-Blog will focus on a field that I have a lot of experience with over the past few years: Arduino. Though I’ve been dabbling with this microcontroller for about three years, I figured it would be beneficial to take this entry-level course and learn the coding from the ground up.

I’ve been posting Arduino-related projects here for quite some time without really explaining what the thing actually is or even what it looks like. Essentially, the Arduino microcontroller is a very basic processor that can take physical inputs (like switches and sensors) and control a variety of digital outputs (like lights and motors).

Arduino Uno

Arduino SMT Uno Board

The reason I love the Arduino so much is its versatility. It doesn’t have enough memory to process audio or video, but it can be used as a controller for cameras, motors, LED lights, MIDI instruments, light sensors, you name it. The possibilities are endless.

In Week 1, we were instructed to build a circuit that would blink an LED light. The code is relatively simple, and was reminiscent of an Arduino-based Christmas tree I built in 2009:

So I decided to get a bit creative and make a cascading LED pattern. Press the switch, and the LEDs light up in sequence. Release the switch, and they cascade in the other direction. Simple, straightforward, and fun.

LED Cascade from Mark Kleback on Vimeo.

Here’s the code:

void setup()
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(2, INPUT);
void loop()
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
digitalWrite(10, HIGH);
digitalWrite(11, HIGH);
digitalWrite(12, HIGH);
digitalWrite(12, LOW);
digitalWrite(11, LOW);
digitalWrite(10, LOW);
digitalWrite(9, LOW);
digitalWrite(8, LOW);
digitalWrite(7, LOW);

I’ll have more complicated Arduino projects in the next few weeks!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: