Test Code for TowerPro SG 5010
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
// coded by Dr. Abhishek Ghosh @AbhishekCTRL | |
// under GNU GPL 3.0 | |
// https://thecustomizewindows.com/ | |
// Written for testing TowerPro SG 5010 with Arduino UNO powered from USB | |
// yellow -> pin 9, brown -> ground/GND, red -> 5v, | |
#include <Servo.h> | |
Servo towerprosg5010; | |
int pos = 0; | |
void setup() | |
{ | |
towerprosg5010.attach(9); | |
} | |
void loop() | |
{ | |
for(pos = 0; pos < 180; pos += 1) // 0 to 180 degrees with 1 degree step | |
{ | |
towerprosg5010.write(pos); | |
delay(120); // time set 120 ms to reach sloooooowly | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment