refactor - change constants
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
-> Document the battery pack lib
|
||||
-> Program underfloorLighting
|
||||
-> Program battery pack tracking
|
||||
-> Add an beeper
|
||||
-> Program the beeper
|
||||
|
||||
@@ -170,7 +170,7 @@ class MoveControl {
|
||||
|
||||
uint8_t delay = 20;
|
||||
uint8_t overTimeCounter = 0;
|
||||
uint8_t overTimeMax = 10;
|
||||
uint8_t overTimeMax = 100;
|
||||
int8_t rawPowerLeft = 0;
|
||||
int8_t rawPowerRight = 0;
|
||||
uint32_t lastMillis = 0;
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
#define M_DIR_11 12
|
||||
#define M_DIR_12 27
|
||||
#define M_PWM_1 13
|
||||
#define M_ENCODE_1A 33
|
||||
#define M_ENCODE_1B 32
|
||||
#define M_ENCODE_1A 32
|
||||
#define M_ENCODE_1B 33
|
||||
//Right Motor
|
||||
#define M_DIR_21 23
|
||||
#define M_DIR_22 14
|
||||
#define M_PWM_2 22
|
||||
#define M_ENCODE_2A 26
|
||||
#define M_ENCODE_2B 25
|
||||
#define M_ENCODE_2A 25
|
||||
#define M_ENCODE_2B 26
|
||||
|
||||
// PID config
|
||||
#define PID_OUT_MIN -100
|
||||
|
||||
@@ -55,6 +55,7 @@ void Battery::calculateBatteryPercent() {
|
||||
if (this->batteryVoltage <= this->capacityVoltages[i])
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
if (this->batteryVoltage > 6)
|
||||
std::cout << "Critical low battery!" << std::endl;
|
||||
|
||||
@@ -65,7 +65,7 @@ void Navigation::init(Route* route) {
|
||||
Wire.write(0x0b);
|
||||
Wire.write(0x01);
|
||||
Wire.endTransmission();
|
||||
this->compass->setMode(0x01,0x04,0x10,0X00);
|
||||
this->compass->setMode(0x01,0x0C,0x10,0X00);
|
||||
}
|
||||
|
||||
Navigation::~Navigation() {
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
*
|
||||
*/
|
||||
#define MIN_DISTANCE_BETWEEN_POINTS 0.1
|
||||
#define AZIMUTH_UPDATE_DELAY 200
|
||||
#define AZIMUTH_UPDATE_DELAY 20
|
||||
|
||||
/**
|
||||
* @brief This struct inherits the result of the navigation
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#ifndef SPEEDOMETER_H
|
||||
#define SPEEDOMETER_H
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <cstdint>
|
||||
#include <ESP32Encoder.h>
|
||||
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ upload_speed = 921600
|
||||
monitor_port = COM3
|
||||
monitor_filters = esp32_exception_decoder
|
||||
lib_deps =
|
||||
madhephaestus/ESP32Encoder@^0.4.0
|
||||
madhephaestus/ESP32Encoder@^0.10.1
|
||||
jvpernis/PS3 Controller Host@^1.1.0
|
||||
sparkfun/SparkFun u-blox GNSS Arduino Library@^2.2.7
|
||||
knolleary/PubSubClient@^2.8
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ void MoveControl::setDrivingStatus(DrivingStatus status) {
|
||||
}
|
||||
|
||||
void MoveControl::setSpeed(double speed) {
|
||||
if (speed < 0.2 && speed > -0.2)
|
||||
if (speed < 0.1 && speed > -0.1)
|
||||
this->x_speed = 0;
|
||||
else
|
||||
this->x_speed = speed;
|
||||
|
||||
Reference in New Issue
Block a user