It is currently Thu Jun 22, 2017 4:40 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Thu Jan 12, 2017 5:58 pm 
Offline
Member
Member

Joined: Tue Jul 23, 2013 2:36 pm
Posts: 25
Location: Genth, Belgium
Hi,

I've been trying to implement some easing on the movement of the servos.

However I have not been succesfull.

I tried an overload method for the ::move function in the libary.

Can someone see what I have done wrong?

//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);
}

Code is based on this Github code
Robot sketch just stops working.

Thanks in advance !


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group