Step 3.:Getting Started:. (Blinking LED) - CIRC01
What We're Doing:
LEDs (light emitting diodes) are used in all sorts of clever things which is why we have included them in this intro. We will start off with something very simple, turning one on and off, repeatedly, producing a pleasant blinking effect. To get started grab the parts listed below, pin the layout sheet to your breadboard and then plug everything in. Once the circuit is assembled you'll need to upload the program. To do this plug the Arduino board into your USB port. Then select the proper port in Tools > Serial Port > (the comm port of your Arduino). Next upload the program by going to File > Upload to I/O Board (ctrl+U). Finally bask in the glory and possibility that controlling lights offers.
If you are having trouble uploading, a full trouble shooting guide can be found here:
(you can also download the breadboard layout sheet from the bottom of this step)
The Parts:
- CIRC-01 (Getting Started) Breadboard Sheet (x1)
- 2 Pin Header (x4)
- 10mm LED (x1)
- 560 Ohm Resistor (green-blue-brown) (x1)
- wire
The Circuit and Plugging Everything In:
A Small Video of Everything Being Plugged in
The Code:
goto the Arduino IDE (program) and go file > examples > digital > Blink or copy the code below and paste it into an empty sketch file
/* * Blink * * The basic Arduino example. Turns on an LED on for one second, * then off for one second, and so on... We use pin 13 because, * depending on your Arduino board, it has either a built-in LED * or a built-in resistor so that you need only an LED. * * http://www.arduino.cc/en/Tutorial/Blink */int ledPin = 13; // LED connected to digital pin 13void setup() // run once, when the sketch starts{ pinMode(ledPin, OUTPUT); // sets the digital pin as output}void loop() // run over and over again{ digitalWrite(ledPin, HIGH); // sets the LED on delay(1000); // waits for a second digitalWrite(ledPin, LOW); // sets the LED off delay(1000); // waits for a second}Not Working?
- LED Not Lighting Up - LEDs will only work in one direction. Try taking it out and twisting it 180 degrees. (no need to worry, installing it backwards does no permanent harm)
- Program Not Uploading - This happens sometimes, the most likely cause is a confused serial port, you can change this in tools>serial port>
- Still No Success? - A broken circuit is no fun, send us an e-mail and we will get back to you as soon as we can. help@oomlout.com
Making it Better:
Changing the pin:
The LED is connected to pin 13 but we can use any of the Arduino's pins. To change it take the wire plugged into pin 13 and move it to a pin of your choice (from 0-13) (you can also use analog 0-5 analog 0 is 14...)
Then in the code change the line:
int ledPin = 13; -> int ledPin = newpin;
Then upload the sketch: (ctrl-u)
Change the Blink Time:
Unhappy with one second on one second off?
In the code change the lines:
digitalWrite(ledPin, HIGH); delay(time on); //(seconds * 1000) digitalWrite(ledPin, LOW); delay(time off); //(seconds * 1000)
Control the Brightness:
Along with digital (on/off) control the Arduino can control some pins in an analog (brightness) fashion. (more details on this in later circuits). To play around with it.
Change the LED to pin 9: (also change the wire)
ledPin = 13; -> int ledPin = 9;Replace the code inside the { }'s of loop() with this:
analogWrite(ledPin, new number);(new number) = any number between 0 and 255.
0 = off, 255 = on, in between = different brightness
Fading:
We will use another included example program. To open go to.
File > Sketchbook > Examples > Analog > Fade
Then upload to your board and watch as the LED fades in and then out.
Links:
Looking for more details or perhaps the concepts explained in another way, the internet has loads of Arduino references here are a few for this circuit
- Lady Ada's Blink Tutorial (loads of extra detail on why everything is working as it is) - http://www.ladyada.net/learn/arduino/lesson1.html
- The official Arduino.cc Blink Tutorial - http://www.arduino.cc/en/Tutorial/Blink
- Make Magazines excellent Arduino 101 Series on Blink - http://blog.makezine.com/archive/2009/02/howto_tuesday_arduino_101_blink_an_led.html
CIRC01-sheet.pdf(630x810) 42 KB| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|






















































