Thursday 5 March 2020

Arduino Nano Blinking LED

Your first sketch to learn coding with Arduino Nano is to begin with simple basic example.
You need to download Arduino IDE from The LINK. After finish installing the IDE and from the menu, File ... Examples ... Basic. Choose Blink.
The code should look like this:

//
void setup() {
// initialize digital pin LED_BUILTIN as an output or you can assign an digital pin on the board to act as an output
pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second = 1000 mS
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
***////////////////

Now upload the sketch to the connected board with the right COM port and for the right Board name. in our example we choose Arduino Nano 328P.
click on compile to test for errors, after compiling the code you are ready to upload the code the board.. Click on Upload.
After finish uploading the code and normally takes few seconds. You will start see the LED on the board start to blink On and off and time delay in between.
You can adjust the delay by increasing the waiting time between turning the led On and off.

No comments:

Post a Comment