Home
About
Contact
Arduino KIT Use
Header Ads Widget
Responsive Advertisement
Home-text
Home
Buttons on LED off Arduino project
Buttons on LED off Arduino project
AdeebTechnologyLab
November 12, 2019
Circuit Diagram:
Buttons on LED off Arduino project
project details
project details......
Code:
const int ledPin = 7; // setup led in pin 7 const int switchPin = 8; // setup switch in pin 8 void setup() { // put your setup code here, to run once: pinMode(switchPin , INPUT); pinMode(ledPin , OUTPUT); // setting the LED as an OUTPUT } void loop() { // put your main code here, to run repeatedly: if(digitalRead(switchPin) == HIGH) // if you press the switch { digitalWrite(ledPin , HIGH); // turn on the LED } else // otherwise { digitalWrite(ledPin , LOW); // turn off the LED } }
Project Testing Video:
Post a Comment
0 Comments
Social Plugin
Contact form
0 Comments