Open TobiasHaag opened 6 years ago
When calling servoEaser.begin, the ServoEaser reads the current position of the servo object. So you need to call write on the servo object before calling servoEaser.begin.
void setup()
{
Serial.begin(19200);
Serial.println("ServoEaser0ManualEasing");
servo1.attach( servoPin );
servo1.write(160); // set the starting position to 160 degrees
servoEaser.begin( servo1, servoFrameMillis );
Serial.println("moving to 20 degrees over 2 seconds");
servoEaser.easeTo( 20, 2000);
}
Hello todbot, I would like to change the StartPos in the code ServoEaser0ManualEasing.ino (not 90° by default). I tried to add the start position in the
servoEaser.begin( servo1, servoFrameMillis )
method. In ServoEaser.h I changed the method fromvoid begin(Servo s, int frameTime); //, int startPos);
tovoid begin(Servo s, int frameTime, int startPos);
However, the code shows me errors or does not execute. What am I doing wrong? I would be very grateful if you could help me with my problem. Thank you very much! -Tobias Haag-