Skip to content

Instantly share code, notes, and snippets.

@li2hub
Created January 30, 2019 11:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save li2hub/f7d8831de486cbc27a66d052636613e2 to your computer and use it in GitHub Desktop.
Save li2hub/f7d8831de486cbc27a66d052636613e2 to your computer and use it in GitHub Desktop.
void setup() {
pinMode(2,INPUT);
Serial.begin(9600);
}
void loop() {
if(digitalRead(2)==LOW){
Serial.println("0");
}
else{
Serial.println("1");
}
delay(100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment