Multiple pins

Hello everyone!
I started a arduino project, on my UNO, but i cant seem to get multiple pins working :confused:
im using port 12 and 13,
this is the code im using...

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(2000); // wait for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(500); // wait for a second
digitalWrite(12, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(12, LOW); // turn the LED off by making the voltage LOW
delay(50); // wait for a second
}

pinMode(12, OUTPUT); ???

Your pin 12 delays are 1/10 sec on and 1/20 sec off.

None of the delay() periods that you have corresponds with the comment beside it :slight_smile:

...R

You need to set pin 12 as an OUTPUT just as it was done for 13.

You need to make sure your LEDs are hooked up properly (Anode to output board pin, cathode to resistor, resistor to GND pin)

And don't call them "ports". "Ports" refer to an entirely different thing than pins as far as you are concerned.

INTP:
You need to set pin 12 as an OUTPUT just as it was done for 13.

You need to make sure your LEDs are hooked up properly (Anode to output board pin, cathode to resistor, resistor to GND pin)

And don't call them "ports". "Ports" refer to an entirely different thing than pins as far as you are concerned.

Ive done that, it just becomes an error :/...
anyway, It was 3 am when I wrote rhis, so I wasnt thinking straight XD

6v6gt:
pinMode(12, OUTPUT); ???

thanks xD
i wrote first the output 13, then void loop, void setup and then that..