ESP-NOW Transmitter

This commit is contained in:
2025-06-18 02:52:02 -04:00
parent 9e5e2f8e3d
commit aa5442179e
2 changed files with 5 additions and 6 deletions

View File

@@ -151,7 +151,6 @@ void rc_send_data_task()
while (true) { while (true) {
if (esp_now_is_peer_exist((uint8_t*)receiver_mac)) { if (esp_now_is_peer_exist((uint8_t*)receiver_mac)) {
sendData(); sendData();
//sendRawData();
} }
vTaskDelay (1000 / portTICK_PERIOD_MS); vTaskDelay (1000 / portTICK_PERIOD_MS);
} }
@@ -161,7 +160,7 @@ void transmission_init()
{ {
esp_err_t espnow_ret = esp_now_init(); esp_err_t espnow_ret = esp_now_init();
if (espnow_ret != ESP_OK) { if (espnow_ret != ESP_OK) {
//ESP_LOGE(TAG, "Error initializing ESPNOW: %s", espnow_ret); ESP_LOGE(TAG, "Error initializing ESPNOW: %s", espnow_ret);
ESP_LOGE(TAG, "esp_now_init() failed: %s", esp_err_to_name(espnow_ret)); ESP_LOGE(TAG, "esp_now_init() failed: %s", esp_err_to_name(espnow_ret));
return; return;
} }

View File

@@ -10,10 +10,10 @@ typedef struct {
int x_axis; // Joystick x-position int x_axis; // Joystick x-position
int y_axis; // Joystick y-position int y_axis; // Joystick y-position
bool nav_bttn; // Joystick push button bool nav_bttn; // Joystick push button
uint8_t motor1_rpm_pcm; // PWMs for 4 DC motors uint8_t motor1_rpm_pwm; // PWMs for 4 DC motors
uint8_t motor2_rpm_pcm; uint8_t motor2_rpm_pwm;
uint8_t motor3_rpm_pcm; uint8_t motor3_rpm_pwm;
uint8_t motor4_rpm_pcm; uint8_t motor4_rpm_pwm;
} __attribute__((packed)) sensors_data_t; } __attribute__((packed)) sensors_data_t;
#endif #endif