Back to Parent

int servoPin = A1;
Servo myservo;
int servoPosition = 0;
// int servospeed = 200;

void setup() {
    myservo.attach(A1);
    // Particle.function("servo", servoControl);
    // Particle.variable( "servoPosition" , &servoPosition , INT );
}

void loop() {
 for (servoPosition = 0; servoPosition<90; servoPosition++){
        myservo.write( servoPosition );
        delay (150);
    }
for (servoPosition = 00; servoPosition>0; servoPosition--){
        myservo.write( servoPosition );
        delay (150);
    }    

}
Click to Expand

Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0