and I have the below code but it wont blink - I press re set and only one (13) flashes once
int led = 13;
int led2 = 12;
int led3 = 11;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(100);
{digitalWrite(led2, HIGH);
delay(100);
digitalWrite(led2, LOW);
delay(100);}
{digitalWrite(led3, HIGH);
delay(100);
digitalWrite(led3, LOW);
delay(100);}// wait for a second
}
If you go on testing this configuration you will fry your Uno pretty soon, if it is not yet fried!
Whenever you connect something to the output pins of your Arduino, you will have to make sure, that the electric conditions have been cared about.
What I mean:
LED's need a resistor in series with the output pin(s)!!
Your current circuit connects the LED directly with Arduino outputs. LED's need forward voltages beginning at about 1.6V (depending on the colour). To light them, a current of about 2mA .. 15mA is enough.
Let's calculate:
Pin output voltage = 5V (when pin is "HIGH");
Red LED "takes" 1.6V at 10mA to be fairly lit, so
your resistor in series with the red LED should eat up the remaining voltage: (5V - 1.6V) at 10mA, so its value is: (5-1.6V)/10mA = 340 Ohms (so you can go with a 330 Ohm)
You could take 330 Ohm resistors for all coloured LEDs (each of them needs its own resistor!); if one LED is too dark, you can lower the resistor value (start with 270, then 240, then 180 Ohm) - but you will see, modern LEDs will be bright enough normally even if you only got a 1k Ohm resistor in your storage.
But again: Always remember to operate LEDs with resistors, unless you are rich enough to fry one Arduino after the other.
BTW: if your Arduino was already fried, try other I/O pins WITH resistor and LED -> if you are lucky, only the I/Os are killed where the LEDs without resistors were connected to.
In general:
Arduino is set up to be easy for beginners and people who normally don't have a lot to do with electronics.
But - compared to car driving:
In the old times you needed to be an engineer to drive the first cars ...
Today you just need to take a special exam - but this means still learning down to a certain understanding level.
Same applies with Arduinos:
Without any electronics basic knowledge you will always run into trouble.
So my advice:
Learn the basics in electronics if you want to stay with it. There are a lot of good educative books out.
Just pick one for a beginner and start learning the basics of electronics.