ESP-NOW-Transmitter

This commit is contained in:
2025-06-17 11:43:17 -04:00
parent 2b5373c716
commit 10682b7b5d

View File

@@ -36,6 +36,7 @@
#define ESPNOW_MAXDELAY 512 #define ESPNOW_MAXDELAY 512
static const char *TAG = "ESP-NOW_Transmitter"; static const char *TAG = "ESP-NOW_Transmitter";
static sensors_data_t buffer;
static QueueHandle_t s_example_espnow_queue = NULL; static QueueHandle_t s_example_espnow_queue = NULL;
@@ -422,7 +423,7 @@ void sendData (void) {
//ESP_LOGI(TAG, "pcm 3, pcm 4 [ 0x%04X, 0x%04X ]", (uint8_t)buffer.motor3_rpm_pcm, (uint8_t)buffer.motor4_rpm_pcm); //ESP_LOGI(TAG, "pcm 3, pcm 4 [ 0x%04X, 0x%04X ]", (uint8_t)buffer.motor3_rpm_pcm, (uint8_t)buffer.motor4_rpm_pcm);
// Call ESP-NOW function to send data (MAC address of receiver, pointer to the memory holding data & data length) // Call ESP-NOW function to send data (MAC address of receiver, pointer to the memory holding data & data length)
uint8_t result = esp_now_send(receiver_mac, buffer, sizeof(buffer)); uint8_t result = esp_now_send(receiver_mac, &buffer, sizeof(buffer));
// If status is NOT OK, display error message and error code (in hexadecimal). // If status is NOT OK, display error message and error code (in hexadecimal).
if (result != 0) { if (result != 0) {