keil实验,一个智能小车

360U3377877138 |浏览802次
收藏|2022/11/28 07:02

满意回答

2022/11/28 07:18

语法船入河岁玉刚走分上有二处错,改好的#视席准左站调编include <r务径查部剧否植哪做坏觉eg52.h>#define uchar unsigned char#正片么练械define uint unsigned intsbit you = P0 ^ 0;sbit zuo = P0 ^ 1;sbit zhong = P0 ^ 2;sbit right_moto_a = P1 ^ 0;sbit right_moto_b = P1 ^ 1;sbit left_moto_a = P1 ^ 2;sbit left_moto_b = P1 ^ 3;void left();void right();void go();void stop();void delay(char a, char b);void main() //错误1,void360问答拼写错{ whi三载断会拉聚le (1) { if (zuo == 1) left(); else if (you == 1) right(); else if (zhong == 1) go(); else stop格亚责帮满据题血息理(); }}void left(){ right_继根外述状moto_a = 1; right_moto_b 克保好候直慢差= 0; left_调伯项moto_a = 0; left_moto_b = 1; del散技选牛ay(200, 20管志称方写社军0);}void right(){ right_moto_a 效务蛋相越重继足= 0; right_moto_b = 1; left_moto_a = 1; left_moto_笔普沉门快沙裂b = 0; delay(200, 换诉200);}void go(){ right_moto_a = 1; right_moto_b = 0; left_moto_a = 1; left_moto_b = 0;}voi可月早d stop() { //错误2 少了一个{ right_moto_a = 0; right_moto_b = 0; left_moto_a = 0法教调老计文病; left_moto_b = 0;}void delay(char 安太叫杆势过连岩推a, char b){ int i, j; for (i = 0; i < a; i++) for (j = 0; j < b; j++) ;}

whoami1978

其他回答(0)
0人关注该问题
+1

 加载中...