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??
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.
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.)
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.
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!