//write a program to control an led with respeat the positon of switch.led is connect
//to gpio2 and switch gpio4
//use extranal register for swtich
void setup() {
pinMode(4,INPUT_PULLDOWN);
pinMode(2,OUTPUT);
}
void loop() {
int x=digitalRead(4);
if(x==HIGH){
digitalWrite(2,HIGH);
}
else{
digitalWrite(2,LOW);
}
}