Commit 1e65c941 authored by 957dd's avatar 957dd

加入了坦克调速,每种坦克速度不同。驱动也不同

parent a2d093f8
cmake_minimum_required(VERSION 3.10)
project(car
VERSION 1.2.1
VERSION 1.2.3
LANGUAGES C
)
......
No preview for this file type
......@@ -2,194 +2,89 @@
#include "gpio_init.h"
#include "common.h"
int modecount_car0103=0;
void car0103_middle() {
pwmWrite(PWM_PIN_SPEED,75);
pwmWrite(PWM_PIN_CHANGE,75);
}
void mode_car0103_lift_flont(unsigned char gval) {
int b=0;
if (gval < 50) {
pwmWrite(PWM_PIN_SPEED, 75);
} else if (gval <= 55) {
pwmWrite(PWM_PIN_SPEED, 78);
} else if (gval <= 60) {
}
else if (gval <= 60) {
pwmWrite(PWM_PIN_SPEED, 79);
} else if (gval <= 65) {
}else if (gval <= 70) {
pwmWrite(PWM_PIN_SPEED, 80);
} else if (gval <= 70) {
pwmWrite(PWM_PIN_SPEED, 81);
} else if (gval <= 75) {
pwmWrite(PWM_PIN_SPEED, 82);
} else if (gval <= 90) {
pwmWrite(PWM_PIN_SPEED, 83);
} else if (gval <= 100) {
pwmWrite(PWM_PIN_SPEED, 84);
} else if (gval <= 110) {
pwmWrite(PWM_PIN_SPEED, 85);
} else if (gval <= 120) {
pwmWrite(PWM_PIN_SPEED, 86);
} else if (gval <= 130) {
pwmWrite(PWM_PIN_SPEED, 87);
} else if (gval <= 140) {
pwmWrite(PWM_PIN_SPEED, 88);
} else if (gval <= 150) {
pwmWrite(PWM_PIN_SPEED, 89);
} else if (gval <= 160) {
pwmWrite(PWM_PIN_SPEED, 90);
} else if (gval <= 170) {
pwmWrite(PWM_PIN_SPEED, 91);
} else if (gval <= 180) {
pwmWrite(PWM_PIN_SPEED, 92);
} else if (gval <= 190) {
pwmWrite(PWM_PIN_SPEED, 93);
} else if (gval <= 200) {
pwmWrite(PWM_PIN_SPEED, 94);
}
}else if(gval >70){
int flont_speed = 80+(gval-70)/10+b;
pwmWrite(PWM_PIN_SPEED, flont_speed);
}
}
void mode_car0103_lift_back(unsigned char gval) {
int b=0;
if (gval < 50) {
pwmWrite(PWM_PIN_SPEED, 75);
} else if (gval <= 55) {
pwmWrite(PWM_PIN_SPEED, 72);
} else if (gval <= 60) {
pwmWrite(PWM_PIN_SPEED, 71);
} else if (gval <= 65) {
}else if (gval <= 70) {
pwmWrite(PWM_PIN_SPEED, 70);
} else if (gval <= 70) {
pwmWrite(PWM_PIN_SPEED, 69);
} else if (gval <= 75) {
pwmWrite(PWM_PIN_SPEED, 68);
} else if (gval <= 90) {
pwmWrite(PWM_PIN_SPEED, 67);
} else if (gval <= 100) {
pwmWrite(PWM_PIN_SPEED, 66);
} else if (gval <= 110) {
pwmWrite(PWM_PIN_SPEED, 65);
} else if (gval <= 120) {
pwmWrite(PWM_PIN_SPEED, 64);
} else if (gval <= 130) {
pwmWrite(PWM_PIN_SPEED, 63);
} else if (gval <= 140) {
pwmWrite(PWM_PIN_SPEED, 62);
} else if (gval <= 150) {
pwmWrite(PWM_PIN_SPEED, 61);
} else if (gval <= 160) {
pwmWrite(PWM_PIN_SPEED, 60);
} else if (gval <= 170) {
pwmWrite(PWM_PIN_SPEED, 59);
} else if (gval <= 180) {
pwmWrite(PWM_PIN_SPEED, 58);
} else if (gval <= 190) {
pwmWrite(PWM_PIN_SPEED, 57);
} else if (gval <= 200) {
pwmWrite(PWM_PIN_SPEED, 56);
}
} else if(gval >70){
int back_speed = 70 - (gval-70)/10-b;
pwmWrite(PWM_PIN_SPEED, back_speed);
}
}
void mode_car0103_right_flont(unsigned char gval) {
int b=0;
if (gval < 50) {
pwmWrite(PWM_PIN_CHANGE, 75);
} else if (gval <= 55) {
pwmWrite(PWM_PIN_CHANGE, 78);
} else if (gval <= 60) {
}else if (gval <= 60) {
pwmWrite(PWM_PIN_CHANGE, 79);
} else if (gval <= 65) {
}else if (gval <= 70) {
pwmWrite(PWM_PIN_CHANGE, 80);
} else if (gval <= 70) {
pwmWrite(PWM_PIN_CHANGE, 81);
} else if (gval <= 75) {
pwmWrite(PWM_PIN_CHANGE, 82);
} else if (gval <= 90) {
pwmWrite(PWM_PIN_CHANGE, 83);
} else if (gval <= 100) {
pwmWrite(PWM_PIN_CHANGE, 84);
} else if (gval <= 110) {
pwmWrite(PWM_PIN_CHANGE, 85);
} else if (gval <= 120) {
pwmWrite(PWM_PIN_CHANGE, 86);
} else if (gval <= 130) {
pwmWrite(PWM_PIN_CHANGE, 87);
} else if (gval <= 140) {
pwmWrite(PWM_PIN_CHANGE, 88);
} else if (gval <= 150) {
pwmWrite(PWM_PIN_CHANGE, 89);
} else if (gval <= 160) {
pwmWrite(PWM_PIN_CHANGE, 90);
} else if (gval <= 170) {
pwmWrite(PWM_PIN_CHANGE, 91);
} else if (gval <= 180) {
pwmWrite(PWM_PIN_CHANGE, 92);
} else if (gval <= 190) {
pwmWrite(PWM_PIN_CHANGE, 93);
} else if (gval <= 200) {
pwmWrite(PWM_PIN_CHANGE, 94);
}
}else if(gval >70){
int flont_speed = 80+(gval-70)/10+b;
pwmWrite(PWM_PIN_CHANGE, flont_speed);
}
}
void mode_car0103_right_back(unsigned char gval) {
int b=0;
if (gval < 50) {
pwmWrite(PWM_PIN_CHANGE, 75);
} else if (gval <= 55) {
}else if (gval <= 60) {
pwmWrite(PWM_PIN_CHANGE, 71);
} else if (gval <= 60) {
pwmWrite(PWM_PIN_CHANGE, 70);
} else if (gval <= 65) {
pwmWrite(PWM_PIN_CHANGE, 70);
} else if (gval <= 70) {
pwmWrite(PWM_PIN_CHANGE, 70);
} else if (gval <= 75) {
pwmWrite(PWM_PIN_CHANGE, 69);
} else if (gval <= 90) {
pwmWrite(PWM_PIN_CHANGE, 68);
} else if (gval <= 100) {
pwmWrite(PWM_PIN_CHANGE, 68);
} else if (gval <= 110) {
pwmWrite(PWM_PIN_CHANGE, 66);
} else if (gval <= 120) {
pwmWrite(PWM_PIN_CHANGE, 65);
} else if (gval <= 130) {
pwmWrite(PWM_PIN_CHANGE, 64);
} else if (gval <= 140) {
pwmWrite(PWM_PIN_CHANGE, 62);
} else if (gval <= 150) {
pwmWrite(PWM_PIN_CHANGE, 60);
} else if (gval <= 160) {
pwmWrite(PWM_PIN_CHANGE, 59);
} else if (gval <= 170) {
pwmWrite(PWM_PIN_CHANGE, 58);
} else if (gval <= 180) {
pwmWrite(PWM_PIN_CHANGE, 57);
} else if (gval <= 190) {
pwmWrite(PWM_PIN_CHANGE, 56);
} else if (gval <= 200) {
pwmWrite(PWM_PIN_CHANGE, 55);
}
} else if(gval >70){
int back_speed = 70 - (gval-70)/10-b;
pwmWrite(PWM_PIN_CHANGE, back_speed);
}
}
void car0103_change(unsigned char *buf) {
unsigned char mode = buf[1];
unsigned char val = buf[2];
static int modecount_car0103=0;
if(mode == 1 ) {
//mode_lift_flont(val);
mode_car0103_right_back(val);
mode_car0103_right_flont(val);
modecount_car0103=0;
}else if(mode == 2 ) {
//mode_lift_back(val);
mode_car0103_right_flont(val);
mode_car0103_right_back(val);
modecount_car0103=1;
}
if((mode == 1||mode ==2)&&val == 0) modecount_car0103=0;
if(mode == 3) {
if(modecount_car0103 == 0) mode_car0103_lift_back(val+25);
if(modecount_car0103 == 1) mode_car0103_lift_flont(val+25);
if(modecount_car0103 == 0) mode_car0103_lift_back(val);
if(modecount_car0103 == 1) mode_car0103_lift_flont(val);
}else if(mode == 4) {
if(modecount_car0103 == 0) mode_car0103_lift_flont(val+25);
if(modecount_car0103 == 1) mode_car0103_lift_back(val+25);
if(modecount_car0103 == 0) mode_car0103_lift_flont(val);
if(modecount_car0103 == 1) mode_car0103_lift_back(val);
}
}
\ No newline at end of file
......@@ -9,30 +9,34 @@ void car0104_stop() {
}
void car0104_back(unsigned char gval) {
int b=0;
int b=7;
int c=2;
if (gval < 50) {
pwmWrite(PWM_PIN_SPEED, 75);
}
else if (gval <= 60) {
pwmWrite(PWM_PIN_SPEED, 79);
pwmWrite(PWM_PIN_SPEED, 85);
}else if (gval <= 70) {
pwmWrite(PWM_PIN_SPEED, 80);
pwmWrite(PWM_PIN_SPEED, 87);
}else if(gval >70){
int flont_speed = 80+(gval-70)/10+b;
if(flont_speed>95) flont_speed = 95;
pwmWrite(PWM_PIN_SPEED, flont_speed);
}
}
void car0104_flont(unsigned char gval) {
int b=0;
int b=7;
int c=2;
if (gval < 50) {
pwmWrite(PWM_PIN_SPEED, 75);
} else if (gval <= 60) {
pwmWrite(PWM_PIN_SPEED, 71);
pwmWrite(PWM_PIN_SPEED, 65);
}else if (gval <= 70) {
pwmWrite(PWM_PIN_SPEED, 70);
pwmWrite(PWM_PIN_SPEED, 63);
} else if(gval >70){
int back_speed = 70 - (gval-70)/10-b;
if(back_speed<55) back_speed =55;
pwmWrite(PWM_PIN_SPEED, back_speed);
}
}
......@@ -122,14 +126,14 @@ void car0104_change(unsigned char *buf) {
unsigned char val = buf[2];
if(mode == 1 ) {
car0104_flont(val+20);
car0104_flont(val);
}else if(mode == 2 ) {
car0104_back(val+20);
car0104_back(val);
}else if(mode == 3) {
if(val !=0)car0104_lift(90);
if(val !=0) car0104_lift(85);
else car0104_lift(0);
}else if(mode == 4) {
if(val !=0) car0104_right(90);
if(val !=0) car0104_right(85);
else car0104_lift(0);
}
......
......@@ -186,11 +186,11 @@ void tank0202_change(unsigned char *buf) {
if((mode == 1||mode ==2)&&val == 0) g_modecount_tank0202=0;
if(mode == 3) {
if(g_modecount_tank0202 == 0) mode_lift_back(val+20);
if(g_modecount_tank0202 == 1) mode_lift_flont(val+20);
if(g_modecount_tank0202 == 0) mode_lift_back(val+15);
if(g_modecount_tank0202 == 1) mode_lift_flont(val+15);
}else if(mode == 4) {
if(g_modecount_tank0202 == 0) mode_lift_flont(val+20);
if(g_modecount_tank0202 == 1) mode_lift_back(val+20);
if(g_modecount_tank0202 == 0) mode_lift_flont(val+15);
if(g_modecount_tank0202 == 1) mode_lift_back(val+15);
}
}
......@@ -23,6 +23,7 @@ void tank0203_mode_lift_flont(unsigned char gval) {
pwmWrite(PWM_PIN_SPEED, 80);
}else if(gval >70){
int flont_speed = 80+(gval-70)/10+b;
if(flont_speed>95) flont_speed = 95;
pwmWrite(PWM_PIN_SPEED, flont_speed);
}
}
......@@ -37,6 +38,7 @@ void tank0203_mode_lift_back(unsigned char gval) {
pwmWrite(PWM_PIN_SPEED, 70);
} else if(gval >70){
int back_speed = 70 - (gval-70)/10-b;
if(back_speed<55) back_speed =55;
pwmWrite(PWM_PIN_SPEED, back_speed);
}
}
......@@ -51,6 +53,7 @@ void tank0203_mode_right_back(unsigned char gval) {
pwmWrite(PWM_PIN_CHANGE, 80);
}else if(gval >70){
int flont_speed = 80+(gval-70)/10+b;
if(flont_speed>95) flont_speed = 95;
pwmWrite(PWM_PIN_CHANGE, flont_speed);
}
}
......@@ -65,6 +68,7 @@ void tank0203_mode_right_flont(unsigned char gval) {
pwmWrite(PWM_PIN_CHANGE, 70);
} else if(gval >70){
int back_speed = 70 - (gval-70)/10-b;
if(back_speed<55) back_speed =55;
pwmWrite(PWM_PIN_CHANGE, back_speed);
}
}
......
......@@ -9,163 +9,68 @@ void tank0206_middle() {
}
void tank0206_mode_lift_flont(unsigned char gval) {
int b=0;
if (gval < 50) {
pwmWrite(PWM_PIN_SPEED, 75);
} else if (gval <= 55) {
pwmWrite(PWM_PIN_SPEED, 76);
} else if (gval <= 60) {
pwmWrite(PWM_PIN_SPEED, 77);
} else if (gval <= 65) {
pwmWrite(PWM_PIN_SPEED, 78);
} else if (gval <= 70) {
pwmWrite(PWM_PIN_SPEED, 79);
} else if (gval <= 75) {
}
else if (gval <= 55) {
pwmWrite(PWM_PIN_SPEED, 80);
} else if (gval <= 90) {
pwmWrite(PWM_PIN_SPEED, 81);
} else if (gval <= 100) {
pwmWrite(PWM_PIN_SPEED, 82);
} else if (gval <= 110) {
pwmWrite(PWM_PIN_SPEED, 83);
} else if (gval <= 120) {
pwmWrite(PWM_PIN_SPEED, 84);
} else if (gval <= 130) {
pwmWrite(PWM_PIN_SPEED, 85);
} else if (gval <= 140) {
pwmWrite(PWM_PIN_SPEED, 86);
} else if (gval <= 150) {
pwmWrite(PWM_PIN_SPEED, 87);
} else if (gval <= 160) {
pwmWrite(PWM_PIN_SPEED, 88);
} else if (gval <= 170) {
pwmWrite(PWM_PIN_SPEED, 89);
} else if (gval <= 180) {
pwmWrite(PWM_PIN_SPEED, 90);
} else if (gval <= 190) {
pwmWrite(PWM_PIN_SPEED, 91);
} else if (gval <= 200) {
pwmWrite(PWM_PIN_SPEED, 94);
}
}else if (gval <= 90) {
pwmWrite(PWM_PIN_SPEED, 79);
}else if (gval <= 100) {
pwmWrite(PWM_PIN_SPEED, 79);
}else if(gval >100){
int flont_speed = 79+(gval-70)/10+b;
if(flont_speed>95) flont_speed = 95;
pwmWrite(PWM_PIN_SPEED, flont_speed);
}
}
void tank0206_mode_lift_back(unsigned char gval) {
int b=0;
if (gval < 50) {
pwmWrite(PWM_PIN_SPEED, 75);
} else if (gval <= 55) {
pwmWrite(PWM_PIN_SPEED, 74);
} else if (gval <= 60) {
pwmWrite(PWM_PIN_SPEED, 73);
} else if (gval <= 65) {
pwmWrite(PWM_PIN_SPEED, 72);
} else if (gval <= 70) {
pwmWrite(PWM_PIN_SPEED, 71);
} else if (gval <= 75) {
pwmWrite(PWM_PIN_SPEED, 70);
} else if (gval <= 90) {
pwmWrite(PWM_PIN_SPEED, 69);
} else if (gval <= 100) {
pwmWrite(PWM_PIN_SPEED, 68);
} else if (gval <= 110) {
pwmWrite(PWM_PIN_SPEED, 67);
} else if (gval <= 120) {
pwmWrite(PWM_PIN_SPEED, 66);
} else if (gval <= 130) {
pwmWrite(PWM_PIN_SPEED, 65);
} else if (gval <= 140) {
pwmWrite(PWM_PIN_SPEED, 64);
} else if (gval <= 150) {
pwmWrite(PWM_PIN_SPEED, 63);
} else if (gval <= 160) {
pwmWrite(PWM_PIN_SPEED, 62);
} else if (gval <= 170) {
pwmWrite(PWM_PIN_SPEED, 61);
} else if (gval <= 180) {
pwmWrite(PWM_PIN_SPEED, 60);
} else if (gval <= 190) {
pwmWrite(PWM_PIN_SPEED, 59);
} else if (gval <= 200) {
pwmWrite(PWM_PIN_SPEED, 56);
}
}else if (gval <= 90) {
pwmWrite(PWM_PIN_SPEED, 71);
}else if (gval <= 100) {
pwmWrite(PWM_PIN_SPEED, 71);
} else if(gval >100){
int back_speed = 71 - (gval-70)/10-b;
if(back_speed<55) back_speed =55;
pwmWrite(PWM_PIN_SPEED, back_speed);
}
}
void tank0206_mode_right_flont(unsigned char gval) {
int b=0;
if (gval < 50) {
pwmWrite(PWM_PIN_CHANGE, 75);
} else if (gval <= 55) {
pwmWrite(PWM_PIN_CHANGE, 76);
} else if (gval <= 60) {
pwmWrite(PWM_PIN_CHANGE, 77);
} else if (gval <= 65) {
pwmWrite(PWM_PIN_CHANGE, 78);
} else if (gval <= 70) {
}else if (gval <= 60) {
pwmWrite(PWM_PIN_CHANGE, 79);
} else if (gval <= 75) {
pwmWrite(PWM_PIN_CHANGE, 80);
} else if (gval <= 90) {
pwmWrite(PWM_PIN_CHANGE, 81);
} else if (gval <= 100) {
pwmWrite(PWM_PIN_CHANGE, 82);
} else if (gval <= 110) {
pwmWrite(PWM_PIN_CHANGE, 83);
} else if (gval <= 120) {
pwmWrite(PWM_PIN_CHANGE, 84);
} else if (gval <= 130) {
pwmWrite(PWM_PIN_CHANGE, 85);
} else if (gval <= 140) {
pwmWrite(PWM_PIN_CHANGE, 86);
} else if (gval <= 150) {
pwmWrite(PWM_PIN_CHANGE, 87);
} else if (gval <= 160) {
pwmWrite(PWM_PIN_CHANGE, 88);
} else if (gval <= 170) {
pwmWrite(PWM_PIN_CHANGE, 89);
} else if (gval <= 180) {
pwmWrite(PWM_PIN_CHANGE, 90);
} else if (gval <= 190) {
pwmWrite(PWM_PIN_CHANGE, 91);
} else if (gval <= 200) {
pwmWrite(PWM_PIN_CHANGE, 94);
}
}else if (gval <= 100) {
pwmWrite(PWM_PIN_CHANGE, 79);
}else if(gval >100){
int flont_speed = 80+(gval-70)/10+b;
if(flont_speed>95) flont_speed = 95;
pwmWrite(PWM_PIN_CHANGE, flont_speed);
}
}
void tank0206_mode_right_back(unsigned char gval) {
int b=0;
if (gval < 50) {
pwmWrite(PWM_PIN_CHANGE, 75);
} else if (gval <= 55) {
pwmWrite(PWM_PIN_CHANGE, 74);
} else if (gval <= 60) {
pwmWrite(PWM_PIN_CHANGE, 73);
} else if (gval <= 65) {
pwmWrite(PWM_PIN_CHANGE, 72);
} else if (gval <= 70) {
pwmWrite(PWM_PIN_CHANGE, 71);
} else if (gval <= 75) {
}else if (gval <= 60) {
pwmWrite(PWM_PIN_CHANGE, 70);
} else if (gval <= 90) {
pwmWrite(PWM_PIN_CHANGE, 69);
} else if (gval <= 100) {
pwmWrite(PWM_PIN_CHANGE, 68);
} else if (gval <= 110) {
pwmWrite(PWM_PIN_CHANGE, 67);
} else if (gval <= 120) {
pwmWrite(PWM_PIN_CHANGE, 66);
} else if (gval <= 130) {
pwmWrite(PWM_PIN_CHANGE, 65);
} else if (gval <= 140) {
pwmWrite(PWM_PIN_CHANGE, 64);
} else if (gval <= 150) {
pwmWrite(PWM_PIN_CHANGE, 63);
} else if (gval <= 160) {
pwmWrite(PWM_PIN_CHANGE, 62);
} else if (gval <= 170) {
pwmWrite(PWM_PIN_CHANGE, 61);
} else if (gval <= 180) {
pwmWrite(PWM_PIN_CHANGE, 60);
} else if (gval <= 190) {
pwmWrite(PWM_PIN_CHANGE, 59);
} else if (gval <= 200) {
pwmWrite(PWM_PIN_CHANGE, 55);
}
pwmWrite(PWM_PIN_CHANGE, 71);
} else if(gval >100){
int back_speed = 70 - (gval-70)/10-b;
if(back_speed<55) back_speed =55;
pwmWrite(PWM_PIN_CHANGE, back_speed);
}
}
void tank0206_change(unsigned char *buf) {
......@@ -186,12 +91,12 @@ void tank0206_change(unsigned char *buf) {
if((mode == 1||mode ==2)&&val == 0) modecount_tank0206=0;
if(mode == 3) {
if(modecount_tank0206 == 0) tank0206_mode_lift_flont(val+10);
if(modecount_tank0206 == 1) tank0206_mode_lift_back(val+10);
if(modecount_tank0206 == 0) tank0206_mode_lift_flont(val);
if(modecount_tank0206 == 1) tank0206_mode_lift_back(val);
}else if(mode == 4) {
if(modecount_tank0206 == 0) tank0206_mode_lift_back(val+10);
if(modecount_tank0206 == 1) tank0206_mode_lift_flont(val+10);
if(modecount_tank0206 == 0) tank0206_mode_lift_back(val);
if(modecount_tank0206 == 1) tank0206_mode_lift_flont(val);
}
}
......
......@@ -191,9 +191,9 @@ void tank0202_pwm_value(int pin,int value) { //软件陪我们控制调速
if(value==1) {
if(pin == 27){
softPwmWrite(pin, 50);
softPwmWrite(pin, 45);
} else {
softPwmWrite(pin, 30);
softPwmWrite(pin, 40);
my_zlog_debug("pwm:%d",pin);
}
......@@ -218,7 +218,7 @@ void tank0203_pwm_value(int pin,int value) { //软件陪我们控制调速
if(pin == 27){
softPwmWrite(pin, 45);
} else {
softPwmWrite(pin, 30);
softPwmWrite(pin, 35);
my_zlog_debug("pwm:%d",pin);
}
......@@ -241,7 +241,7 @@ void tank0206_pwm_value(int pin,int value) { //软件陪我们控制调速
if(value==1) {
if(pin == 27){
softPwmWrite(pin, 45);
softPwmWrite(pin, 50);
} else {
softPwmWrite(pin, 35);
my_zlog_debug("pwm:%d",pin);
......
......@@ -2,10 +2,6 @@
#include "common.h"
#include "ads1115.h"
#define LIFT_LIMIT 170
#define MIDDLE_LIMIT 180
#define RIGHT_LIMIT 205
double tank_angle(){
double angle=0;
float angle_shot=ads1115_read_channel(2);
......@@ -20,8 +16,11 @@ double tank_angle(){
int angle_limit(){
int tank_limit_angele = tank_angle();
if(tank_limit_angele >=LIFT_LIMIT && tank_limit_angele<=MIDDLE_LIMIT) return 1;
else if(tank_limit_angele >=MIDDLE_LIMIT && tank_limit_angele<=RIGHT_LIMIT) return 2;
return 0;
if(ANGLE_LIMIT_INDEX == 1 ){
int tank_limit_angele = tank_angle();
if(tank_limit_angele >=LIFT_LIMIT && tank_limit_angele<=MIDDLE_LIMIT) return 1;
else if(tank_limit_angele >=MIDDLE_LIMIT && tank_limit_angele<=RIGHT_LIMIT) return 2;
return 0;
}else return 0;
}
\ No newline at end of file
#ifndef TANK_ANGLE_H
#define TANK_ANGLE_H
#define LIFT_LIMIT 160
#define MIDDLE_LIMIT 180
#define RIGHT_LIMIT 210
#define ANGLE_LIMIT_INDEX 1 //是否开启角度旋转
double tank_angle();
int angle_limit();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment