Arduino nano output pins not working

Hello, I have an Arduino nano CH340G (clone). I can download code successfully to that, I can light ON/OFF the build in LED but when I try the code below in order to light ON/OFF a LED using an output pin, it just does not work....Any suggestion??

Thank you....

int ledPin = 7;

void setup()
{
  pinMode(ledPin, OUTPUT);
} 

void loop()
{
  digitalWrite(ledPin, HIGH);
  delay(1000);
  digitalWrite(ledPin, LOW);
  delay(1000);
}

I supplied them directly to +5 Volts and light ON.

Which current limiting resistor did you select?

What if you measure the output voltage with a DVM, with the LED detached?

alex5678:
I supplied them directly to +5 Volts and light ON.

Without enough resistor the led should light brightly for a short time only.
I think that you left out a detail in your post.....

Have you a multimeter?

You connected an LED straight to +5v and ground without a resistor? that will generally burn out the LED within under a second (if it's a normal indicator LED). You MUST use a current limiting resistor with LEDs.

Sorry, yes, I use a 220 Ohm resistor...

alex5678:
Sorry, yes, I use a 220 Ohm resistor...

Please post the schematic of your circuit. Hand drawn will do.

alex5678:
Sorry, yes, I use a 220 Ohm resistor...

With all the suggestions and questions, that all you got? Since you are using a nano, are sure you have the anode of the LED plugged into pin 7? Typically, it's the longer lead. The cathode should hook to the resistor, and the other side of the resistor to ground.

Test your LED again, and show us a picture (and schematic) of your circuit. Is your nano a real one? I have a super-cheap clone nano with half of the pins dead (I suspect they are not even hooked up.)

This is the circuit...(see attachment)

alex5678:
Sorry, yes, I use a 220 Ohm resistor...

It is because the problem often lies in small details that we want to make sure about them.
Only way to do that is get all the details shown. Help is quicker and easier that way.

int ledPin = 7;

So why is the LED resistor connected to pin 4 and not pin 7 ?

It's a bit offputting for beginners (but there is a reason)
The Arduino logical pin numbers are NOT the same as the package physical pin numbers.
Good luck with your learning!

Lastchancename and Bob have figured it out - make the change illustrated below, and you'll be blinking!

Arduino.cc main site provides product information.