Skip to content

Instantly share code, notes, and snippets.

@li2hub
Last active July 10, 2018 15:30
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/e330adcd19e50c7122630b9df452c77d to your computer and use it in GitHub Desktop.
Save li2hub/e330adcd19e50c7122630b9df452c77d to your computer and use it in GitHub Desktop.
void setup()
{
pinMode (2, INPUT);
pinMode (3, OUTPUT);
}
void loop()
{
if (digitalRead(2)== 1)
{
digitalWrite(3, HIGH);
}
else
{
digitalWrite(3, LOW);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment