Servo Sweep Example Not working

Status
Not open for further replies.

Peter2708

Member
I have tried two HS-311 servos. Windows 10. Teensy 3.2. I am using the Teensy servo library.

The example sweep code:

// Sweep
// by BARRAGAN <http://barraganstudio.com>

#include <Servo.h>

Servo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created

int pos = 0; // variable to store the servo position

void setup()
{
myservo.attach(20); // attaches the servo on pin 20
}


void loop()
{
for(pos = 10; pos < 170; pos += 1) // goes from 10 degrees to 170 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for(pos = 180; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}

The problem is that the servo only goes in one direction, then stops and gets quite hot.
 
Resolved

I have tried two HS-311 servos. Windows 10. Teensy 3.2. I am using the Teensy servo library.

The example sweep code:



The problem is that the servo only goes in one direction, then stops and gets quite hot.


This is resolved. Not sure what the solution was, possibly 0.4v too much from the battery pack.
 
Status
Not open for further replies.
Back
Top