BNSS - IoT & Robotics Training

OBJECTIVE

Understand the functions of Push buttons and LEDs, and control LEDs using Arduino platform.

MODULES REQUIRED
SCHEMATIC DIAGRAM
Following connection are made in inbuilt circuit, so there no need made these connection:
ARDUINO CODE
JavaScript
int LOW2=1;
int HIGH2=0;
void setup(){
pinMode(12, OUTPUT);
digitalWrite(12, LOW2);
pinMode(2,INPUT_PULLUP);
Serial.begin(9600);
}
void loop(){
int button = digitalRead(2);
delay(10);
Serial.print(button);
if (button){
digitalWrite(12, HIGH2);
delay(1000); // Wait for 1000 millisecond(s)
digitalWrite(12, LOW2);
delay(500); // Wait for 1000 millisecond(s)
}}
INSTRUCTIONS
WORKING

LED CONTROL USING PUSH BUTTONS

IOT Projects

LED CONTROL USING PUSH BUTTONS

/ /

LED CONTROL USING PUSH BUTTONS

OBJECTIVE

Understand the functions of Push buttons and LEDs, and control LEDs using Arduino platform.

MODULES REQUIRED
SCHEMATIC DIAGRAM
Following connection are made in inbuilt circuit, so there no need made these connection:
ARDUINO CODE
JavaScript
int LOW2=1;
int HIGH2=0;
void setup(){
pinMode(12, OUTPUT);
digitalWrite(12, LOW2);
pinMode(2,INPUT_PULLUP);
Serial.begin(9600);
}
void loop(){
int button = digitalRead(2);
delay(10);
Serial.print(button);
if (button){
digitalWrite(12, HIGH2);
delay(1000); // Wait for 1000 millisecond(s)
digitalWrite(12, LOW2);
delay(500); // Wait for 1000 millisecond(s)
}}
INSTRUCTIONS
WORKING

LED CONTROL USING PUSH BUTTONS