Last active
August 19, 2016 15:02
-
-
Save greymd/78a4c6dbf35611e84220 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int VIB = 2; | |
int state = LOW; | |
void setup(){ | |
Serial.begin(9600); | |
pinMode(VIB,OUTPUT); | |
} | |
void loop(){ | |
if (Serial.available()) { | |
char c = Serial.read(); | |
if (c == '1') { | |
state = HIGH; | |
} else if (c == '0') { | |
state = LOW; | |
} | |
} | |
digitalWrite(VIB, state); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment