User manual

www.sainsmart.com
Copyright © 2013 SainSmart All Rights Reserved
pin to use as the output.
This line tells it to move from 0 degrees to 180 degrees one degree at a time:
for(pos = 0; pos < 180; pos += 1)
And this line tells it to move back to 0 degrees one degree at a time.
for(pos = 180; pos>=1; pos-=1)