Created
September 27, 2016 15:14
-
-
Save elktros/35f5fe90503ed7c93463638b24673f70 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 servosweep; | |
float pos = 0.0; | |
void setup() | |
{ | |
servosweep.attach(11); | |
} | |
void loop() | |
{ | |
for (pos = 0; pos <= 180; pos += 1.0) | |
{ | |
servosweep.write(pos); | |
delay(20); | |
} | |
for (pos = 180; pos >= 0; pos -= 1.0) | |
{ | |
servosweep.write(pos); | |
delay(20); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment