欢迎来到天天文库
浏览记录
ID:12850623
大小:93.00 KB
页数:24页
时间:2018-07-19
《智能灭火机器人设计第程序》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、附录1main.c#include"wei.h"#defineP_IOA_Data(volatileunsignedint*)0x7000#defineP_IOA_Dir(volatileunsignedint*)0x7002#defineP_IOA_Attrib(volatileunsignedint*)0x7003#defineP_IOB_Data(volatileunsignedint*)0x7005#defineP_IOB_Dir(volatileunsignedint*)0x7007#defineP_IOB_Attrib(volatileunsignedint*)0x7008#def
2、ineP_TimerB_Data(volatileunsignedint*)0x700C#defineP_TimerB_Ctrl(volatileunsignedint*)0x700D#defineP_INT_Ctrl(volatileunsignedint*)0x7010#defineP_INT_Clear(volatileunsignedint*)0x7011#defineP_ADC(volatileunsignedint*)0x7014#defineP_ADC_Ctrl(volatileunsignedint*)0x7015#defineP_ADC_MUX_Ctrl(volatileun
3、signedint*)0x702B#defineP_ADC_MUX_Data(volatileunsignedint*)0x702C#defineC_FIQ_PWM0x8000//P_INT_Ctrl#defineC_FIQ_TMA0x2000//P_INT_Ctrl#defineC_FIQ_TMB0x0800//P_INT_Ctrl#defineC_IRQ4_1KHz0x0010//P_INT_Ctrl#defineC_IRQ4_2KHz0x0020//P_INT_Ctrl#defineC_IRQ4_4KHz0x0040//P_INT_Ctrl#defineC_IRQ5_2Hz0x0004/
4、/P_INT_Ctrl#defineC_IRQ5_4Hz0x0008//P_INT_Ctrl#defineC_TMB_32KHz0x0002//P_TimerB_Ctrl#defineC_TMB_PWM_OFF0x0000//P_TimerB_Ctrl#defineP_Watchdog_Clear(volatileunsignedint*)0x7012unsignedintmm,min,cny,Delaynumber,xp=255,flag,dd;unsignedintleft,right;unsignedintpulse_x,pulse_y;unsignedintpaixu[7];//排序u
5、nsignedintchdata[7];//火焰传感器检测通道unsignedintworkstate=0;//进入检测范围unsignedintsucessfire=0;//灭火成功标记voidPWM_left(unsignedinthigh_time,unsignedintcyclical_time);voidPWM_right(unsignedinthigh_time,unsignedintcyclical_time);voidforward(unsignedintm,unsignedintn);voidforward_s(unsignedintm,unsignedintn);voidf
6、orward_s2(unsignedintm,unsignedintn);voidbackward(unsignedintm,unsignedintn);voidturn_left(unsignedintm);voidturn_right(unsignedintm);voidstop(void);voidget_AD(void);//AD转换voidsystem_init(void);//系统初始化voiddelay_ms(unsignedintt);//ms级延时程序voiddelay_s(unsignedintt);//s级延时程序voidadjust(void);//调整voidadju
7、st_s(void);//粗调voidseekfire(void);//寻找火源voidfire(void);//灭火voidhf(void);intabs(intm);voidbizhan(void);//避障voidbiya(void);//避崖voidStage0(void);//阶段0voidStage1(void);//阶段1voidStage2(void);//阶段2voidStage
此文档下载收益归作者所有