AVR128小车红外循迹程序(经典实用)

只需要两个红外模块检测,程序简单简洁实用。准确

* AVR_hongwai.c

*两个红外对管足以

*/

#include <avr/io.h>

//#include <util/delay.h>

#define uchar unsigned char

#define uint unsigned int

#define Right_moto_go {PORTB |= 1<<PB4;PORTB &= ~(1<<PB5);} //

#define Right_moto_back {PORTB &= ~(1<<PB4);PORTB |= 1<<PB5;} // #define Left_moto_back {PORTB &= ~(1<<PB6);PORTB |= 1<<PB7;} // #define Left_moto_go {PORTB |= 1<<PB6;PORTB &= ~(1<<PB7);} // #define Right_moto_goo {PORTB |= 1<<PB4;PORTB &= ~(1<<PB5);}

void run(void);

void forward(void);

void turn_left(void);

void turn_right(void);

void forward()

{

Right_moto_go; Left_moto_go;

你可能喜欢

  • 自动循迹小车
  • 循迹小车设计报告
  • 循迹小车
  • 红外循迹小车
  • 红外循迹小车程序

AVR128小车红外循迹程序(经典实用)相关文档

最新文档

返回顶部