Last active
August 29, 2015 14:01
-
-
Save nilsonpessim/f93af3499e62ce0a8056 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
#include <Servo.h> | |
Servo motor; | |
int serial; | |
void setup(){ | |
Serial.begin(9600); | |
motor.attach(6); | |
} | |
void loop(){ | |
if(Serial.available()){ | |
serial = Serial.read(); | |
if (serial == 'a') { | |
motor.write(0); | |
} | |
if (serial == 'b') { | |
motor.write(90); | |
} | |
if (serial == 'c') { | |
motor.write(180); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment