1
1
// Copyright (c) 2021 Juan Miguel Jimeno
2
2
//
3
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.esp32
4
+ // you may not use this file except in compliance with the License.
5
5
// You may obtain a copy of the License at
6
6
//
7
7
// http://www.apache.org/licenses/LICENSE-2.0
15
15
#ifndef ESP32_CONFIG_H
16
16
#define ESP32_CONFIG_H
17
17
18
- #define LED_PIN 2 //used for debugging status
18
+ #define LED_PIN LED_BUILTIN //used for debugging status
19
19
20
20
//uncomment the base you're building
21
21
#define LINO_BASE DIFFERENTIAL_DRIVE // 2WD and Tracked robot w/ 2 motors
@@ -59,14 +59,14 @@ ROBOT ORIENTATION
59
59
#define MOTOR_OPERATING_VOLTAGE 12 // motor's operating voltage (used to calculate max RPM)
60
60
#define MOTOR_POWER_MAX_VOLTAGE 12 // max voltage of the motor's power source (used to calculate max RPM)
61
61
#define MOTOR_POWER_MEASURED_VOLTAGE 12 // current voltage reading of the power connected to the motor (used for calibration)
62
- #define COUNTS_PER_REV1 550 // wheel1 encoder's no of ticks per rev
63
- #define COUNTS_PER_REV2 550 // wheel2 encoder's no of ticks per rev
64
- #define COUNTS_PER_REV3 550 // wheel3 encoder's no of ticks per rev
65
- #define COUNTS_PER_REV4 550 // wheel4 encoder's no of ticks per rev
62
+ #define COUNTS_PER_REV1 450 // wheel1 encoder's no of ticks per rev
63
+ #define COUNTS_PER_REV2 450 // wheel2 encoder's no of ticks per rev
64
+ #define COUNTS_PER_REV3 450 // wheel3 encoder's no of ticks per rev
65
+ #define COUNTS_PER_REV4 450 // wheel4 encoder's no of ticks per rev
66
66
#define WHEEL_DIAMETER 0.0560 // wheel's diameter in meters
67
67
#define LR_WHEELS_DISTANCE 0.224 // distance between left and right wheels
68
- #define PWM_BITS 10 // PWM Resolution of the microcontroller
69
- #define PWM_FREQUENCY 20000 // PWM Frequency
68
+ #define PWM_BITS 12 // PWM Resolution of the microcontroller
69
+ #define PWM_FREQUENCY 100 // PWM Frequency
70
70
71
71
// INVERT ENCODER COUNTS
72
72
#define MOTOR1_ENCODER_INV false
@@ -198,8 +198,8 @@ ROBOT ORIENTATION
198
198
#define LIDAR_SERVER { 192, 168, 1, 100 } // eg IP of the desktop computer
199
199
#define LIDAR_PORT 8889
200
200
#define BAUDRATE 115200
201
- // #define SDA_PIN 21 // specify I2C pins
202
- // #define SCL_PIN 22
201
+ #define SDA_PIN 21 // specify I2C pins
202
+ #define SCL_PIN 22
203
203
#define NODE_NAME "esp32"
204
204
// #define TOPIC_PREFIX "esp32/"
205
205
@@ -218,7 +218,11 @@ const int16_t ADC_LUT[4096] = { /* insert adc_calibrate data here */ };
218
218
// #define ECHO_PIN 32
219
219
#define USE_SHORT_BRAKE // for shorter stopping distance
220
220
// #define WDT_TIMEOUT 60 // Sec
221
- // #define BOARD_INIT sleep(5) // wait to begin IMU calibration
221
+ #define BOARD_INIT { \
222
+ Wire.begin(SDA_PIN, SCL_PIN); \
223
+ Wire.setClock(400000); \
224
+ }
225
+ // #define BOARD_INIT_LATE {}
222
226
223
227
#ifdef USE_SYSLOG
224
228
#define RCCHECK (fn ) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){ \
0 commit comments