Skip to content

Commit

Permalink
board: esp32 use nodemcu-32s and LED_BUILTIN for better compatibility
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Chou <[email protected]>
  • Loading branch information
hippo5329 committed Feb 24, 2024
1 parent 9164104 commit 2fcda0d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
26 changes: 15 additions & 11 deletions config/custom/esp32_config.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2021 Juan Miguel Jimeno
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.esp32
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
Expand All @@ -15,7 +15,7 @@
#ifndef ESP32_CONFIG_H
#define ESP32_CONFIG_H

#define LED_PIN 2 //used for debugging status
#define LED_PIN LED_BUILTIN //used for debugging status

//uncomment the base you're building
#define LINO_BASE DIFFERENTIAL_DRIVE // 2WD and Tracked robot w/ 2 motors
Expand Down Expand Up @@ -59,14 +59,14 @@ ROBOT ORIENTATION
#define MOTOR_OPERATING_VOLTAGE 12 // motor's operating voltage (used to calculate max RPM)
#define MOTOR_POWER_MAX_VOLTAGE 12 // max voltage of the motor's power source (used to calculate max RPM)
#define MOTOR_POWER_MEASURED_VOLTAGE 12 // current voltage reading of the power connected to the motor (used for calibration)
#define COUNTS_PER_REV1 550 // wheel1 encoder's no of ticks per rev
#define COUNTS_PER_REV2 550 // wheel2 encoder's no of ticks per rev
#define COUNTS_PER_REV3 550 // wheel3 encoder's no of ticks per rev
#define COUNTS_PER_REV4 550 // wheel4 encoder's no of ticks per rev
#define COUNTS_PER_REV1 450 // wheel1 encoder's no of ticks per rev
#define COUNTS_PER_REV2 450 // wheel2 encoder's no of ticks per rev
#define COUNTS_PER_REV3 450 // wheel3 encoder's no of ticks per rev
#define COUNTS_PER_REV4 450 // wheel4 encoder's no of ticks per rev
#define WHEEL_DIAMETER 0.0560 // wheel's diameter in meters
#define LR_WHEELS_DISTANCE 0.224 // distance between left and right wheels
#define PWM_BITS 10 // PWM Resolution of the microcontroller
#define PWM_FREQUENCY 20000 // PWM Frequency
#define PWM_BITS 12 // PWM Resolution of the microcontroller
#define PWM_FREQUENCY 100 // PWM Frequency

// INVERT ENCODER COUNTS
#define MOTOR1_ENCODER_INV false
Expand Down Expand Up @@ -198,8 +198,8 @@ ROBOT ORIENTATION
#define LIDAR_SERVER { 192, 168, 1, 100 } // eg IP of the desktop computer
#define LIDAR_PORT 8889
#define BAUDRATE 115200
// #define SDA_PIN 21 // specify I2C pins
// #define SCL_PIN 22
#define SDA_PIN 21 // specify I2C pins
#define SCL_PIN 22
#define NODE_NAME "esp32"
// #define TOPIC_PREFIX "esp32/"

Expand All @@ -218,7 +218,11 @@ const int16_t ADC_LUT[4096] = { /* insert adc_calibrate data here */ };
// #define ECHO_PIN 32
#define USE_SHORT_BRAKE // for shorter stopping distance
// #define WDT_TIMEOUT 60 // Sec
// #define BOARD_INIT sleep(5) // wait to begin IMU calibration
#define BOARD_INIT { \
Wire.begin(SDA_PIN, SCL_PIN); \
Wire.setClock(400000); \
}
// #define BOARD_INIT_LATE {}

#ifdef USE_SYSLOG
#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){ \
Expand Down
2 changes: 1 addition & 1 deletion firmware/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ build_flags =

[env:esp32]
platform = espressif32
board = esp32dev
board = nodemcu-32s
board_build.f_flash = 80000000L
board_build.flash_mode = qio
board_build.partitions = min_spiffs.csv
Expand Down

0 comments on commit 2fcda0d

Please sign in to comment.