Skip to content

Instantly share code, notes, and snippets.

@rockos
Created April 4, 2015 00:05
Show Gist options
  • Save rockos/837a40bfd46bdd1ac1d9 to your computer and use it in GitHub Desktop.
Save rockos/837a40bfd46bdd1ac1d9 to your computer and use it in GitHub Desktop.
#include <Servo.h>
Servo u_srv;
Servo l_srv;
void setup()
{
u_srv.attach(10);
l_srv.attach(12);
}
void loop()
{
int pos;
for (pos = 10; pos <= 90; pos += 1)
{
u_srv.write(pos);
l_srv.write(pos);
delay(15);
}
for(pos = 90; pos >=1; pos-=1)
{
u_srv.write(pos);
l_srv.write(pos);
delay(15);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment