Simple LED blik - not working

Dear friends,

New to Arduino.Using MEGA 2560. I run the blink program successfully and see the LED blink. When, try to connect External LED as shown in picture. There is no response. Even i tried, breadboard with 10 K resistor. I may missing something basic. :frowning:
Confirm LED is working it not fault. Any suggestion welcome.

Cheers!
Chandra

Looks to me like you put it in the wrong holes. That's not D13 and GND, looks more like AREF and SDA.

With the Revision 3 versions of Arduino boards, additional pin headers were added. Specifically two new pins were added for SCL and SDA next to the Aref pin.

While the way you attached the LED would work for older revision boards, the newer ones require you to put the LED two pins further in from the end.

You are far better off reading the text printed on the Arduino board when inserting components rather than by counting pins.


Also, put a resistor in series with the LED to reduce the risk of damage to the microcontroller (waits for the flurry of remarks about the resistor not being needed, ignore said remarks and do it anyway, safety first)

[quote author=Tom Carpenter link=topic=178734.msg1324871#msg1324871 date=1374488914] With the Revision 3 versions of Arduino boards, additional pin headers were added. Specifically two new pins were added for SCL and SDA next to the Aref pin. [/quote]

Yes, but they're still labelled correctly...

fungus: Yes, but they're still labelled correctly...

Refer to the third line of my post :)

I would be willing to bet that if you moved the legs of the LED to pin 13 and ground, It would work for you. In the picture you provided you are in AREF and GND.

daveydav27:
I would be willing to bet that if you moved the legs of the LED to pin 13 and ground, It would work for you. In the picture you provided you are in AREF and GND.

We already pointed that out.

The pin to the left of AREF in that pic isn’t GND.

Sorry for late reply. Got it. Problem solved. :). Overwhelmed by your reply and support. XD.True to spirit, another(basic) question. I am reading “Arduino cookbook” by Michael Margolis. As shown in attached pic. connecting TWO external LEDs. It is working. Code is below.
Fine, now I try to When First LED is ON /Second OFF - Second is ON when First is OFF. As suggested by author in the book discussion(page 222 on 2011 edition) is happen when either one of LEDs Cathode connected to Pin and Anodes to Ground). So, Simpy reversed the polarity of second LED, but is not blinks at all. simply off ;only first LED blinks.

NOTE: I use 330 Ohm resistor instead of 220 Ohm as mentioned in pic.
Any thoughts? Am i missing something?

/* LED Sketch */
/*Blink 2 LED each connected different pin */

const int firstLedPin =3;
const int secondLedPin =5;

void setup() {
  // put your setup code here, to run once.
  
  pinMode(firstLedPin,OUTPUT); // declare LED output
  pinMode(secondLedPin,OUTPUT); // declare LED output
   
}
void loop() {
 // put your main code here, to run repeatedly: 
    blinkLED(firstLedPin,1000);
    blinkLED(secondLedPin,1000);
 }
void blinkLED(int pin,int duration)
{
  digitalWrite(pin,HIGH);
  delay(duration);
  digitalWrite(pin,LOW);
}