Skip to content

Instantly share code, notes, and snippets.

@michaelsarduino
Created December 8, 2015 18:31
Show Gist options
  • Save michaelsarduino/a175b24b8c09fb0fba79 to your computer and use it in GitHub Desktop.
Save michaelsarduino/a175b24b8c09fb0fba79 to your computer and use it in GitHub Desktop.
void setup ()
{
pinMode (13, OUTPUT) ;
pinMode (3, INPUT) ;
}
int val;
void loop ()
{
val = digitalRead (3) ;
if(val == HIGH) //Bei Beruehrung
{
digitalWrite (13, HIGH); //LED AN
}
else
{
digitalWrite (13, LOW); //LED AUS
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment