Skip to content

Instantly share code, notes, and snippets.

@tkzw21
Created December 25, 2015 13:51
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 tkzw21/728c34c48b04d2810c7b to your computer and use it in GitHub Desktop.
Save tkzw21/728c34c48b04d2810c7b to your computer and use it in GitHub Desktop.
void setup(){
pinMode(13, OUTPUT);
Serial.begin(9600);
}
void loop(){
char input[30];
int inputchar;
inputchar = Serial.read();
if(inputchar != -1 ){
if(inputchar == 'a'){
for(int i=0;i<5;i++){
digitalWrite(13, HIGH);
delay(250);
digitalWrite(13,LOW);
delay(250);
}
}else if(inputchar == 'w'){
digitalWrite(13, HIGH);
delay(1250);
digitalWrite(13,LOW);
}
}
else {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment