control 3 servo(180 deg)

LINIX Brushless, VEXTA Brushless, RC Servo, DC Geared, Linear, Stepper, Tamiya.....

control 3 servo(180 deg)

Postby syahmi » Sat Apr 24, 2010 1:42 am

aiii,i want some example source code for control 3 servo motor at the same time..
my project is face expression..1 servo for control the mouth,and 2 servo control the eyebrow..i used 180 deg servomotor..for the input,i used a push button..
syahmi
Freshie
 
Posts: 6
Joined: Fri Apr 16, 2010 11:13 pm

Re: control 3 servo(180 deg)

Postby waiweng83 » Mon Apr 26, 2010 9:44 am

To save your life, it's easier to use the servo controller: http://www.cytron.com.my/viewProduct.ph ... UwVIydxCw=
With the power of dream, nothing is impossible...
User avatar
waiweng83
Moderator
 
Posts: 205
Joined: Wed Apr 15, 2009 2:17 pm

Re: control 3 servo(180 deg)

Postby shahrul » Tue Jul 06, 2010 2:34 pm

To control servo, just use Timer Interrupt.
This is example
static void interrupt isr(void)
{
if(TMR0IF==1){
TMR0IF=0;
counter++;
if(counter==position) SERVO=0;
if(counter==390){
counter=0;
SERVO=1;}
}
}

You can see the full example here.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor


Return to DC Motor

Who is online

Users browsing this forum: No registered users and 7 guests

cron