if(rcservo_Initialize(RCSERVO_USECHANNEL9)){
unsigned long motion[32]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
//set motion for playing
rcservo_EnterPlayMode();
motion[9]=650;
while(true){
if(motion[9]!=650)
motion[9]=650;
else
motion[9]=2400;
rcservo_SetAction(motion, 50);//play motion in 500ms
while (rcservo_PlayAction() != RCSERVO_PLAYEND) { //I dont want to use this line.
//
//can do something here when sending PWM pulses
//
printf("Setting motion[9] = %ld \n",motion[9]);
}
delay(1);
}
}
rcservo_Close();
rcservo_SendPWMPulses(9, 10000L, motion[9], 1);
rcservo_SendPWMPulses(10, 10000L, motion[10], 1);
if(rcservo_Initialize(RCSERVO_USECHANNEL9)){
unsigned long motion[32]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
//set motion for playing
rcservo_EnterPlayMode();
rcservo_SetServo(9, RCSERVO_HITEC_HSR8498);
pwm_SetCountingMode(9, PWM_CONTINUE_MODE);
rcservo_EnterPWMMode();
while(true){
if(motion[9]!=650)
motion[9]=650;
else
motion[9]=2400;
rcservo_SendPWMPulses(9, 20000L, motion[9],1);
usleep(100000);
}
}
rcservo_Close();