Skip to content

Instantly share code, notes, and snippets.

@AbhishekGhosh
Last active October 19, 2020 19:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AbhishekGhosh/cea7e4345d671b834cde to your computer and use it in GitHub Desktop.
Save AbhishekGhosh/cea7e4345d671b834cde to your computer and use it in GitHub Desktop.
Test Code for TowerPro SG 5010
// 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