Velleman / ALLBOT-lib

Arduino library for the ALLBOT system
10 stars 16 forks source link

Feature Request - Easing for Allbot Move #2

Open TobiasVdb opened 7 years ago

TobiasVdb commented 7 years ago

Please add overload method to allow for easing in the ::move method of the library.

I tried an overload method for the ::move function in the libary. I tried it myself, but it's not working :).

//void ALLBOT::move(int servo, int angle, int start, int duration) BOT.move(hipFrontLeft,10,45,100);

// start: beginning value,angle: change in value, duration void ALLBOT::move(int servo, int angle, int start, int duration) { for (int pos=start; pos<duration; pos++){ //move servo from 0 and 140 degrees forward int moveValue = angle(pos/=duration)pos*pos + start; Serial.println("moving to angle" + moveValue); _servo[servo].move(moveValue); _servo[servo].tick(); delay(15); //wait for the servo to move } //_servo[servo].move(angle); }

(Based on https://github.com/tobiastoft/ArduinoEasing)

velbn commented 7 years ago

Sorry for the late answer. We're currently looking into it. Did you make any progress with it?