Skip to content

Instantly share code, notes, and snippets.

@ysam12345
Created July 4, 2018 16:47
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 ysam12345/2e86b1be4a07d8918ec8a2a423329a82 to your computer and use it in GitHub Desktop.
Save ysam12345/2e86b1be4a07d8918ec8a2a423329a82 to your computer and use it in GitHub Desktop.
void setup() {
pinMode(A0, INPUT);
pinMode(13, OUTPUT);
}
void loop() {
int switchStatus;
switchStatus=digitalRead(A0);
if(switchStatus==LOW)
{
digitalWrite(13, LOW);
}
else
{
digitalWrite(13, HIGH);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment