⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 motor_control.h

📁 利用avr c编程的综合程序
💻 H
字号:
#ifndef _MOTOR_CONTROL_
#define _MOTOR_CONTROL_

#include <util/delay.h>
#include <avr/io.h>

#include "motor.h"
#include "sensor.h"
#include "time.h"
#include "uart.h"
#include "position.h"

#include "led_disp.h"

#define Sensor_PD6 (status[0]&0x40)
#define Hold_pole (status[0]&0x40)

#define Sensor_PB0 (status[1]&0x04)
#define Left_backward_side (status[1]&0x04)

#define Sensor_PB1 (status[1]&0x08)
#define Left_backward_straight (status[1]&0x08)

#define Sensor_PD2 (status[0]&0x04)
#define Right_backward_side (status[0]&0x04)

#define Sensor_PD3 (status[0]&0x08)
#define Right_backward_straight (status[0]&0x08)



#define Sensor_PC0 (status[1]&0x10)
#define Left_forward_side (status[1]&0x10)

#define Sensor_PC1 (status[1]&0x20)
#define Left_forward_straight (status[1]&0x20)

#define Sensor_PC2 (status[1]&0x40)
#define Right_forward_side (status[1]&0x40)

#define Sensor_PC3 (status[1]&0x80)
#define Right_forward_straight (status[1]&0x80)

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -