From 0e537a39d16621e79d0c55ee48c859f0e552b3e3 Mon Sep 17 00:00:00 2001 From: Alex Mikhalev Date: Wed, 23 Jan 2019 19:24:06 -0800 Subject: [PATCH] fix pin issues --- main/ugv_comms.cc | 4 ++-- main/ugv_io_gps.cc | 4 ++-- main/ugv_io_mpu.cc | 4 ++-- main/ugv_main.cc | 5 ++++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/main/ugv_comms.cc b/main/ugv_comms.cc index 2b41951..eef3f61 100644 --- a/main/ugv_comms.cc +++ b/main/ugv_comms.cc @@ -59,8 +59,8 @@ void CommsClass::Init() { #else e32::Config lora_config; lora_config.uart_port = UART_NUM_2; - lora_config.uart_rx_pin = 10; - lora_config.uart_rx_pin = 11; + lora_config.uart_rx_pin = 13; + lora_config.uart_tx_pin = 15; ret = lora.Init(lora_config); if (ret != ESP_OK) { const char *error_name = esp_err_to_name(ret); diff --git a/main/ugv_io_gps.cc b/main/ugv_io_gps.cc index 3f96f39..8838e19 100644 --- a/main/ugv_io_gps.cc +++ b/main/ugv_io_gps.cc @@ -12,8 +12,8 @@ namespace io { static constexpr size_t GPS_BUF_SIZE = 1024; static constexpr uart_port_t GPS_UART = UART_NUM_1; -static constexpr int GPS_UART_TX_PIN = 17; -static constexpr int GPS_UART_RX_PIN = 23; +static constexpr int GPS_UART_TX_PIN = 25; +static constexpr int GPS_UART_RX_PIN = 26; static constexpr int GPS_UART_BAUD = 9600; static constexpr size_t GPS_UART_RX_BUF_SIZE = 1024; static constexpr size_t GPS_UART_TX_BUF_SIZE = 0; diff --git a/main/ugv_io_mpu.cc b/main/ugv_io_mpu.cc index 774d596..6fe73de 100644 --- a/main/ugv_io_mpu.cc +++ b/main/ugv_io_mpu.cc @@ -9,8 +9,8 @@ namespace ugv { namespace io { -static constexpr gpio_num_t MPU_SDA = GPIO_NUM_2; -static constexpr gpio_num_t MPU_SCL = GPIO_NUM_3; +static constexpr gpio_num_t MPU_SDA = GPIO_NUM_12; +static constexpr gpio_num_t MPU_SCL = GPIO_NUM_14; static constexpr mpud::accel_fs_t MPU_ACCEL_FS = mpud::ACCEL_FS_2G; static constexpr mpud::gyro_fs_t MPU_GYRO_FS = mpud::GYRO_FS_500DPS; static constexpr float MPU_MAG_TO_FLUX = (4912.f) / (32760.f); diff --git a/main/ugv_main.cc b/main/ugv_main.cc index 6f9c9aa..9deb038 100644 --- a/main/ugv_main.cc +++ b/main/ugv_main.cc @@ -17,7 +17,10 @@ static const char *TAG = "ugv_main"; U8G2 *oled; void setup_oled(void) { - oled = new U8G2_SSD1306_128X64_NONAME_F_HW_I2C(U8G2_R0, 16, 15, 4); + // For Heltec ESP32 LoRa + // oled = new U8G2_SSD1306_128X64_NONAME_F_HW_I2C(U8G2_R0, 16, 15, 4); + // For wemos Lolin ESP32 + oled = new U8G2_SSD1306_128X64_NONAME_F_HW_I2C(U8G2_R0, 16, 4, 5); oled->initDisplay(); oled->clearDisplay(); oled->setPowerSave(false);