noob question

I’m very new to the Arduino arena. I’ve been following Paul Mcwhorters lessons on youtube to try and figure out and understand the programming etc.

This is probably something easy and I have overlooked something stupid.

At any rate… my bread board had 2 blinking LEDs… as soon as I added the 2 codes for Serial and uploaded my 2 lights went solid and I haven’t been able to figure out why. I have read, and reread the code for any type of error. I also compared mine against his and saw that it looked identical and his LEDs remained blinking.

I know this is a noob thing… but any insight as to what I’ve missed would help.

Thanks.

int redLED=0; //declaring my red led as an int, and i set it to 0
int yellowLED=1; //declaring my yellow led as an int, and i set it to 1
int redOnTime=900; // this is the red LED on time
int redOffTime=900; // this is the red LED off time
int yellowOnTime=900; // this is the yellow LED on time
int yellowOffTime=900; // this is the yellow LED off time
int numYellowBlinks=5; // Numer of times blink yellow LED
int numRedBlinks=5; //number of times to blink red LED

void setup() {

Serial.begin(9600);
pinMode(redLED, OUTPUT);
pinMode(yellowLED, OUTPUT);

}

void loop() {

for (int j=1; j<=numRedBlinks; j=j+1) { //start for our loop
Serial.println(j);
digitalWrite(redLED, HIGH); //TURN THE RED LED ON
delay(redOnTime); // wait
digitalWrite(redLED, LOW); // turn the red LED off
delay(redOffTime); // wait

}

for (int j=1; j<=numYellowBlinks; j=j+1) { //start for our loop
digitalWrite(yellowLED, HIGH); //Turn the yellow LED on
delay(yellowOnTime); //wait
digitalWrite(yellowLED, LOW); // Turn the yellow LED off
delay(yellowOffTime); //Wait

}

}

It's because you have your leds on pins 0 and 1 which also serve as the Serial rx and tx pins. If you're going to use Serial, then you can't use 0 and 1 for your leds.

What Delta_G said.

Ah.. I wondered if that would be an issue but it didn't seem to be as we moved along in the videos.

Thanks so much for the quick response.

int redLED=0; //declaring my red led as an int, and i set it to 0 int yellowLED=1; //declaring my yellow led as an int, and i set it to 1

Make these

int redLED=2; //declaring my red led as an int, and i set it to 2 int yellowLED=3; //declaring my yellow led as an int, and i set it to 3

Edit: Delta_Force to fast