Beginner - LED Light

I am just starting out. I wanted to light up just one LED on pin 12. I tested the led just by running the power pin next to the ground and it lit up.

void setup() {
// put your setup code here, to run once:
pinMode(12, OUTPUT);
}

void loop() {
// put your main code here, to run repeatedly:
digitalWrite(12, HIGH);

}

Here is the simple program. It will not light the LED up on PIN12. I then put the power to the 7th pin and it started to blink.
Is there something else I am missing

Are you putting a resistor in line with the LED (470R or 1K) ?

try the blink example and change the pin to the pin you want (pin 13 is the internal led) and change the delay time and upload that to the board.

davidchert:
I then put the power to the 7th pin and it started to blink.

What do you mean by "put the power to the 7th pin'?!?

I do not have the resister in line with the LED. I have it inline with the negative lead. What I mean about the power to pin 7 is that I ran a check and the led works

I figured out the problem. My usb cable was bad. Thanks for the help