欢迎来到天天文库
浏览记录
ID:28330623
大小:167.54 KB
页数:24页
时间:2018-12-09
《智能灭火机器人第程序》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
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#de
2、fineP_IOB_Attrib(volatileunsignedint*)0x7008#defineP_TimerB_Data(volatileunsignedint*)0x700C#defineP_TimerB_Ctrl(volatileunsignedint*)0x700D#defineP_INT_Ctrl(volatileunsignedint*)0x7010#defineP_INT_Clear(volatileunsignedint*)0x7011#defineP_ADC(volatile
3、unsignedint*)0x7014#defineP_ADC_Ctrl(volatileunsignedint*)0x7015#defineP_ADC_MUX_Ctrl(volatileunsignedint*)0x702B#defineP_ADC_MUX_Data(volatileunsignedint*)0x702C#defineC_FIQ_PWM0x8000//P_INT_Ctrl#defineC_FIQ_TMA0x2000//P_INT_Ctrl#defineC_FIQ_TMB0x0800
4、//P_INT_Ctrl#defineC_IRQ4_1KHz0x0010//P_INT_Ctrl#defineC_IRQ4_2KHz0x0020//P_INT_Ctrl#defineC_IRQ4_4KHz0x0040//P_INT_Ctrl#defineC_IRQ5_2Hz0x0004//P_INT_Ctrl#defineC_IRQ5_4Hz0x0008//P_INT_Ctrl#defineC_TMB_32KHz0x0002//P_TimerB_Ctrl#defineC_TMB_PWM_OFF0x0
5、000//P_TimerB_Ctrl#defineP_Watchdog_Clear(volatileunsignedint*)0x7012unsignedintmm,min,cny,Delaynumber,xp=255,flag,dd;unsignedintleft,right;unsignedintpulse_x,pulse_y;unsignedintpaixu[7];//排序unsignedintchdata[7];//火焰传感器检测通道unsignedintworkstate=0;//进入检测
6、范围unsignedintsucessfire=0;//灭火成功标记voidPWM_left(unsignedinthigh_time,unsignedintcyclical_time);voidPWM_right(unsignedinthigh_time,unsignedintcyclical_time);voidforward(unsignedintm,unsignedintn);voidforward_s(unsignedintm,unsignedintn);voidforward_s2(un
7、signedintm,unsignedintn);voidbackward(unsignedintm,unsignedintn);voidturn_left(unsignedintm);voidturn_right(unsignedintm);voidstop(void);voidget_AD(void);//AD转换24voidsystem_init(void);//系统初始化voiddelay_ms(unsignedintt);//ms级延时程序voiddelay_s(unsignedintt)
8、;//s级延时程序voidadjust(void);//调整voidadjust_s(void);//粗调voidseekfire(void);//寻找火源voidfire(void);//灭火voidhf(void);intabs(intm);voidbizhan(void);//避障voidbiya(void);//避崖voidStage0(void);//阶段0voidStage1(void);//阶段1voidStage2(void);//阶段2voidSta
此文档下载收益归作者所有