Skip to content

Instantly share code, notes, and snippets.

@michaelsarduino
Created December 18, 2015 15:37
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 michaelsarduino/8fc1aa47e4a75d3deb44 to your computer and use it in GitHub Desktop.
Save michaelsarduino/8fc1aa47e4a75d3deb44 to your computer and use it in GitHub Desktop.
void setup() {
Serial.begin(9600);
pinMode(7, INPUT);
}
void loop() {
if(digitalRead(7) == HIGH)
{
Serial.println("Frei!");
}
else {
Serial.println("Objekt erkannt!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment