#ifndef _MOTOR_H_ #define _MOTOR_H_ #include "main.h" extern int led_flag; //led灯开关标志 extern int mov_flag; //脉冲标志 extern int send_flag; //发送标志 extern int seat_flag; //位置标志 extern int motor_dire; //电机转动方向 extern int Travle_Flag; //0 直 1 角 extern char Motor_Run; //0 停止 1 运行 2 运行到起始点 3 运行到结束点 extern char Run_Mode; //0 点动 1 连续(方案一) 2 连续(方案二) extern unsigned int Run_Step; //电机运行步长(0.5mm / °) extern unsigned int Run_Inter; //电机运行间隔时长(ms) extern unsigned int Run_Stop; //到“结束点”后,停止时间(s) extern unsigned int Run_mm; //行进长度(mm) extern unsigned int Run_num; //角行程转动圈数 extern unsigned int ct_num; //磁条长度 extern uint8_t motor_data[]; //发送数组 extern uint16_t SUR_DEVICE_ADDR; //PC //0x00A1; //设备 extern uint16_t OBJ_DEVICE_ADDR; //主板 //0x00B1; //PC群发 FFFF 0000 //void motor_start(void); //电机启动 //void motor_stop(void); //电机停止 //void FWD(void); //正转 //void REV(void); //反转 void ClrRunmotorStep(void); //清除电机标记 void Deal_Motor(void); //处理马达运行 void mov_loop1(void); //电机连续运行,方案一(直行程) //void mov_loop1_ang(void); //电机连续运行,方案一(角行程) //void mov_loop2(void); //电机连续运行,方案二(直行程) //void mov_loop2_ang(void); //电机连续运行,方案二(角行程) void mov_step(void); //电机点动运行,方案三(直行程) //void mov_step_ang(void); //电机点动运行,方案三(角行程) //void motor_mov(unsigned int speed); //电机速度控制 //void mov_begin(void); //电机回到起始位 //void mov_end(void); //电机回到结束位 //void motor_seat(void); //电机位置判断 #endif