The required library depends on the micro module used.
int Led = 13 ;
int buttonpin = 7;
int val = 0;
void setup () {
pinMode (Led, OUTPUT) ;
pinMode (buttonpin, INPUT) ;
}
void loop () {
val = digitalRead(buttonpin);
if (val == HIGH) {
digitalWrite (Led, HIGH);
} else {
digitalWrite (Led, LOW);
}
}
No downloadable resources added yet.

Please login to leave a comment.
No comments yet. Be the first to share your thoughts!