void Dialog::on_source_forward_pressed() { if(!ui->traject_source_forward->isChecked()) { Axes_Mask axes; axes = {0}; axes.a4 = 1; emit move_2(axes,MAX_FREQUENCY); } }
void Dialog::on_source_left_pressed() { if(!ui->traject_source_left->isChecked()) { Axes_Mask axes; axes = {0}; axes.a1 = 1; emit move_2(axes,~MAX_FREQUENCY); } }
void Dialog::on_object_up_pressed() { if(!ui->traject_object_up->isChecked()) { Axes_Mask axes; axes = {0}; axes.a2 = 1; emit move_2(axes,~MAX_FREQUENCY); } }
int tekant(t_visu *visu, t_bunny_position *pos, int i) { float pente; pente = get_pente(pos); if ((pente >= -1) && (pente <= 1)) { if (move_1(visu, pente, pos, i) == -1) return (-1); } else if (move_2(visu, pente, pos, i) == -1) return (-1); return (0); }
int main(void) { PATTEN mode; System_Init(); read_books(); delay_ms(5000); mode = line_set(); //放书时间 TIM_SetCompare1(TIM4,900); //PWM脉冲占空比调节 TIM_SetCompare2(TIM4,900); F_Straight(); delay_ms(1500); if(mode==PATTEN1) move_1(); else if(mode == PATTEN2) move_2(); else move_3(); while(1){ GPIO_ResetBits(GPIOF,GPIO_Pin_9 | GPIO_Pin_10); delay_ms(500); GPIO_SetBits(GPIOF,GPIO_Pin_9 | GPIO_Pin_10); delay_ms(500); } }