Hello everyone!! Welcome to this post on Arduino Projects!!
Need a short introduction to what the Arduino is then click on LINK
Check out the breadboard intro right HERE
So in this project we’ll see how to turn LED on with the help of a switch
Demo:
This is what my project looks like:
Things Required:
- Arduino UNO
- USB AB cable
- LED (any color)
- Breadboard
- 220 ohm resistor
- Arduino IDE on computer
- jumper wires
Functions used:
Video Tutorial:
I used this video as a reference: (LINK)
Code:
int led= 9;
int button= 8;
int dt=100;
int buttonread;
void setup() {
// put your setup code here, to run once:
pinMode(led, OUTPUT);
pinMode(button, INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
buttonread= digitalRead(button);
Serial.println(buttonread);
if (buttonread==1){
digitalWrite(led,LOW);
}
if(buttonread==0){
digitalWrite(led, HIGH);
}
delay(dt);
}
Stay Tuned for upcoming posts on Arduino Projects! We’re on the basic newbie projects right now and slowly, gradually move on to those cool, ultra techy projects!! Want to be the first to know when a new and amazing post comes up?? Then feel free to subscribe!
Happy Learning!!
