|
主程序的一小部分
#include <reg52.h>
#include <string.h>
#include <stdlib.h>
#include "bt.h"
#include "carbasic.h"
#include "timer.h"
#include "track.h"
#include "avoid.h"
extern bit commend_fininsh;
extern unsigned int pwm1;
extern unsigned int pwm2;
extern unsigned char ml[20];
extern unsigned char command_team[3][15];
//?????????
void main(void){//1
Serial_init();
Timer1_Init();
while(1){//2
if(commend_fininsh==1){//3
commend_fininsh=0;
//LED5=0;
Command_Token(ml);
/////////////////////////////////////////////////////
if(strcmp(command_team[1],"control")==0){//6
if(command_team[2][0]=='0'){
//???
FORWOARD();
}
if(command_team[2][0]=='1'){
//????
BACK();
}
if(command_team[2][0]=='2'){
//???
LEFT();
}
if(command_team[2][0]=='3'){
//???
RIGHT();
}
if(command_team[2][0]=='4'){
//????
CIECLE_LEFT();
}
if(command_team[2][0]=='5'){
//????
CIECLE_RIGHT();
}
if(command_team[2][0]=='6'){
//????
FLOWER();
}
if(command_team[2][0]=='7'){
//??
STOP();
}
} //6
}
///////////////////////////////////////////////////
//??????????
|
-
-
智能小车.zip
40.96 KB, 下载次数: 4, 下载积分: 黑币 -5
可以直接使用
|