Arduino IoT beginner Level Small Projects 2020 | LED interface with Arduino UNO Board| different way
Required Components:
1)Arduino UNO board
2)Resister 10ohms
3)LED 5v
LED programming try different ways:
First, think you need to download and configure Arduino IDE software, IDE better experience to developed your Arduino projects
after you download this IDE you installing your PC or Laptop connect a USB cable and configure your laptop to the Arduino board
try this following simple LED programming in your Arduino you will be wondering! this thinks now let's get started.
------------------------------------------------------------------------------------------------------------------
LED Blink Programming.
Open your Arduino IDE and open a new sketch
type the following code in the editor to make default LED in Arduino on and off for 5 seconds.
Code:
const int ledpin = 13;
void setup()
{
pinMode(ledpinDUTPUT):
}
void loop()
{
d1gita1Write(ledpin,I-HGH);
}
void loop()
{
d1gita1Write(ledpin,I-HGH);
delay(5000);
digitalWrite(ledpin,LOW);
delay(5000);
}
Verify and Upload the program.
}
Verify and Upload the program.
-------------------------------------------------------------------------------------------------------------------
EXTERNAL LED GLOW PROGRAM
Connect the external LED in a breadboard. Connect
LED short leg to the ground of Arduino GND pin and LED long leg to Arduino 10th pin.
Open your Arduino IDE and open a new sketch
type the following code in the editor to make External LED in Arduino on and off for 5 seconds.
Code:
const int led = 10;
void setup()
{
pinMode(led,OUTPUT);
}
void loop()
{
digitalWrite(led,HIGH);
delay(5000);
digitalWrite(led,LOW);
delay(5000);
}
Verify and Upload the program.
-----------------------------------------------------------------------------------------------------------------------
EXTERNAL LED GLOW PROGRAM USING ARRAY'S
Connect 3 external LED's in the breadboard
Connect LED's short leg to Ground of Arduino GND pin and a long leg to Arduino 10,12 and 13th pin.
Code:
const int led[]={10,12,13};
int i=0;
void setup()
{
for(i=0;i<=2;i++)
{
pinMode(led[i],OUTPUT);
}
}
void loop()
{
for(int i=0;i<=2;i++)
{
digitalWrite(led[i],HIGH);
delay(5000);
digitalWrite(led[i],LOW);
delay(5000);
}
}
disclaimer
This article is for informational and educational purposes only, does not constitute legal advice and does not establish any kind, illegal activists
This article is for informational and educational purposes only, does not constitute legal advice and does not establish any kind, illegal activists
0 comments: