Introduction: Arduino - Blinking LED
This is my first project with Arduino in instructables, but I create robots for few years with arduino.
The first I want I show you is The magic Hello World , that in electronics means Blinking LED!
Step 1: What Do You Need :
- Arduino - I have a diferent versions but I wanna use Arduino Duemilanove and iDuno.
- Led Resistor - you can calculate but I generally use 220ohm.
- Wire.
Step 2: Parts & Schema
The protoboard I use to be more easy the wired.
Insert led check out how I put the led in the schematic is the position,
Connect the resistor to the led, and connect pin 13 on your arduino to a spot on yhe breadboard.
Step 3: Software
For this Arduino create some small tutorial programs that just you can download into the microcontrollers.
- open the Files
- go to the Sketch Book
- go to examples
- then to Digital
- and open 'Blink'
when you done with this go to the upload button above the screen and select it when its done you see the led starts to blink.
Step 4: Code
This is basically the code:
First create a variable call led with a value 13 that is the pin in the arduino.
With pinMode we put our variable in OUTPUT mode , that means that the pin of arduino is waiting for a signal to pass to the led.
In the loop we change the signal from high to low, that permite to us see the blink!!!
int led = 13;
void setup() {
pinMode(led, OUTPUT);
}
void loop() {
digitalWrite(led, HIGH);
delay(1000);
digitalWrite(led, LOW);
delay(1000);
}
6 Comments
8 years ago on Introduction
I have never worked with Arduino before. Am I right in assuming that the "delay(1000)" is the time in milliseconds that the LED is on or off? So on this example it's on 1 sec, then off 1 sec, repeat.. So on delay 25 you'd get exactly 20 pulses per second then.. (25 on, 25 off x 20 = 1000 milliseconds)
Is the Arduino output strong enough to operate a relay switch?
I'm thinking it could be useful for paintball markers - I have an old mechanical marker and upgrading it to electronic control is expensive. Looks like it could be DIY'd..
Switch > Arduino > Relay switch > Solenoid trigger control..
Should be possible to add an electronic safety, single shot, burstmode and full-auto as well..
Reply 8 years ago
Hi it's posible but you need add some circuits . I promise create a toturial use one of this to control something. And is a good idea for a paintball marker.
8 years ago on Introduction
That's a good start. Keep it up and soon you'll have a featured Instructable!
Reply 8 years ago on Introduction
I will , thanks a lot!!!
8 years ago on Introduction
Good start indeed. I like no nonsense instructables like this one. Specially when they come with a movie. (quite a bright green LED that your're using when looking at your movie).
Reply 8 years ago on Introduction
Thanks a lot!! I will continue create good things!!!