Blinking wont work

Hi

I have this set up

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
}

What I notice is extra curly brackets within the body of your loop() function.

I'm not sure what they would mean, but they are certainly not necessary and may be inhibiting something. Try removing them.

Your last delay should be 1000 for one second.

-- a7

int led = 13;
int led2 = 12;
int led3 = 11;

void setup() {

pinMode(led, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);

}

void loop() {
digitalWrite (led, HIGH);
delay (1000);
digitalWrite(led, LOW);
delay(1000);
digitalWrite(led2, HIGH);
delay(100);
digitalWrite(led2, LOW);
delay(100);
digitalWrite(led3, HIGH);
delay(100);
digitalWrite(led3, LOW);
delay(100);
}

Does this get rid of them? Also, how do I put the last delay should be 1000 for one second in the code?

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:

  1. Pin output voltage = 5V (when pin is "HIGH");
  2. Red LED "takes" 1.6V at 10mA to be fairly lit, so
  3. 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.

And: pls read the forum rules!!
When posting your sketch, pls use code tags!!

This is the button top left of your editor menu.
Then your code appears in a separate window and looks like I did it for you:

int led = 13;
int led2 = 12;
int led3 = 11;

void setup() {

  pinMode(led, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
  
}


void loop() {
  digitalWrite (led, HIGH);
  delay (1000);
  digitalWrite(led, LOW);
  delay(1000);
  digitalWrite(led2, HIGH);
  delay(100);
  digitalWrite(led2, LOW);
  delay(100);
  digitalWrite(led3, HIGH);
  delay(100);
  digitalWrite(led3, LOW);
  delay(100);
}

Okay thank you for your help. Where do I put the resistors in?

Thanks a lot

(deleted)

Where do I put the resistors in?

Have a look at this informative site.

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.