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