Created
March 24, 2018 09:35
-
-
Save thefzsalam/4e64cb7b35fcb2c8d912ca904294a4c8 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 servoMain; // Define our Servo | |
void setup() | |
{ | |
servoMain.attach(10); // servo on digital pin 10 | |
Serial.begin(9600) | |
} | |
void loop() | |
{ | |
long deg = Serial.parseInt(); | |
if(deg == 0) return; | |
Serial.print("Turning: "); | |
Serial.print(deg); | |
Serial.println(" degrees."); | |
servoMain.write(deg); | |
delay(100); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment