From 1a501dcf9ff6916a16e11e45936d7cd2eee0aa9c Mon Sep 17 00:00:00 2001 From: Alexander B Date: Fri, 3 Jan 2025 19:23:57 -0500 Subject: [PATCH] . --- ESP-IDF_Robot_RC/main/config.h | 17 ++++++++++++++++- ESP-IDF_Robot_RC/main/espnow_example_main.c | 14 ++------------ 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/ESP-IDF_Robot_RC/main/config.h b/ESP-IDF_Robot_RC/main/config.h index dbf02b973..c3dd538fb 100644 --- a/ESP-IDF_Robot_RC/main/config.h +++ b/ESP-IDF_Robot_RC/main/config.h @@ -5,11 +5,26 @@ #ifndef CONFIG_H #define CONFIG_H -/* +/* ============================ Joystick + ============================ */ #define PROJ_X (1) // ADC1_CH1; 0 GPIO joystick, x-axis #define PROJ_Y (0) // ADC1_CH0; 1 GPIO joystick, y-axis #define NAV_BTN (8) // 8 GPIO joystick button +/* ============================ + + ESP NOW + ============================ + + ESP32-C3 Luatos ESP32C3 board MAC: 54:32:04:46:71:80 + ESP32-C3 SuperMini MAC: 34:b7:da:f9:33:8d + ESP32-C3 Breadboard MAC: e4:b0:63:17:9e:45 +*/ +static uint8_t broadcast_mac[ESP_NOW_ETH_ALEN] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; +static uint8_t robot_mac[ESP_NOW_ETH_ALEN] = {0xE4, 0xB0, 0x63, 0x17, 0x9E, 0x45}; // MAC address of Robot +static uint8_t rc_mac[ESP_NOW_ETH_ALEN] = {0x34, 0xB7, 0xDA, 0xF9, 0x33, 0x8D}; // MAC address of Remote Control +static uint8_t receiver_mac[ESP_NOW_ETH_ALEN] = {0xE4, 0xB0, 0x63, 0x17, 0x9E, 0x45}; + #endif \ No newline at end of file diff --git a/ESP-IDF_Robot_RC/main/espnow_example_main.c b/ESP-IDF_Robot_RC/main/espnow_example_main.c index 39970d523..54af0c45b 100755 --- a/ESP-IDF_Robot_RC/main/espnow_example_main.c +++ b/ESP-IDF_Robot_RC/main/espnow_example_main.c @@ -41,24 +41,14 @@ #define PROJ_Y (0) // ADC1_CH0; 1 GPIO joystick, y-axis #define NAV_BTN (8) // 8 GPIO joystick button*/ -/* - ============================ - ESP NOW - ============================ - ESP32-C3 Luatos ESP32C3 board MAC: 54:32:04:46:71:80 - ESP32-C3 SuperMini MAC: 34:b7:da:f9:33:8d - ESP32-C3 Breadboard MAC: e4:b0:63:17:9e:45 -*/ -static uint8_t receiver_mac[ESP_NOW_ETH_ALEN] = {0xE4, 0xB0, 0x63, 0x17, 0x9E, 0x45}; + //static uint8_t receiver_mac[ESP_NOW_ETH_ALEN] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; static esp_now_peer_info_t peerInfo; static uint8_t flagToSend = 0; -static uint8_t broadcast_mac[ESP_NOW_ETH_ALEN] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; -static uint8_t robot_mac[ESP_NOW_ETH_ALEN] = {0xE4, 0xB0, 0x63, 0x17, 0x9E, 0x45}; // MAC address of Robot -static uint8_t rc_mac[ESP_NOW_ETH_ALEN] = {0x34, 0xB7, 0xDA, 0xF9, 0x33, 0x8D}; // MAC address of Remote Control + static sensors_data_t *buf; static sensors_data_t *buffer;