ESP32-C3 RC & Receiver

This commit is contained in:
2025-01-04 04:42:22 -05:00
parent 0c2bdbe9ac
commit d8a64ad9b0

View File

@@ -139,10 +139,16 @@ void app_main(void)
wifi_init();
esp_now_init();
esp_now_register_recv_cb(onDataReceived);
esp_now_register_send_cb(onDataSent);
//esp_now_register_send_cb(onDataSent);
memcpy (peerInfo.peer_addr, receiver_mac, 6);
esp_now_add_peer(&peerInfo);
if (esp_now_is_peer_exist(receiver_mac)) {
ESP_LOGI("ESP-NOW", "Receiver exists.");
sendData();
}
else
ESP_LOGE("ESP-NOW", "Receiver does not exists.");
xTaskCreate (rc_send_data_task, "RC", 2048, NULL, 15, NULL);
}