Codeconia -Learn Programming

Get started with Arduino

Arduino is an open-source programmable electronics platform based on easy-to-use hardware and software.

The Arduino Programming Language is basically a framework built on top of C++. It actually not a real programming language in the term, but I think this helps to avoid confusion for beginners.

In this tutorial, we are going to look at how we can make some LED lighting circuits with Arduino.

Required Components 

Arduino uno Buy Now
Breadboard Buy Now
LED Buy Now
  • On top: we have to define pins
  • Then in void setup: declare pin mode
  • Then we can write our function

 

Basic LED Lighting Code

int led = 13;

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

void loop() { 
   digitalWrite(led, HIGH);
}

LED Blinking Code (use the same circuit)

int led = 13;

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

void loop() {  
   digitalWrite(led, HIGH);   
   delay(200); // means 200 milliseconds
   digitalWrite(led, LOW); 
   delay(200);
}

2 LED Dancing Code

int led = 13;
int led1 = 5;

void setup() {
  pinMode(led, OUTPUT);
  pinMode(led1, OUTPUT);
}

void loop() {
   digitalWrite(led, HIGH);
   digitalWrite(led1, LOW);
   delay(100);
   digitalWrite(led, LOW);
   digitalWrite(led1, LOW);
   delay(100);
   digitalWrite(led, HIGH);
   digitalWrite(led1, LOW);
   delay(100);
   digitalWrite(led, LOW);
   digitalWrite(led1, LOW);
   delay(100);
   digitalWrite(led1, HIGH);
   digitalWrite(led, LOW);
   delay(100);
}

to learn more about this checkout the video.

Hope you learn something new. wait for the next article. and enable the push notification to get latest updates real-time

Thank you

Ajith Jojo

Add comment

Follow us

Don't be shy, get in touch. We love meeting interesting people and making new friends.

Most popular

Most discussed