mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-08-08 04:02:29 +00:00
RC
This commit is contained in:
0
ESP-IDF_Robot_RC/build/.ninja_lock
Normal file
0
ESP-IDF_Robot_RC/build/.ninja_lock
Normal file
@@ -1 +1 @@
|
|||||||
f8cf74592c494d85404466ebec3035cf452b2ad6
|
fe7d7fcb2d83fafc92ff8e1755b15ad4c83c0ff6
|
||||||
|
@@ -98,15 +98,15 @@ void sendData (void) {
|
|||||||
buffer.motor4_rpm_pcm = 0;
|
buffer.motor4_rpm_pcm = 0;
|
||||||
|
|
||||||
get_joystick_xy(&x, &y);
|
get_joystick_xy(&x, &y);
|
||||||
ESP_LOGI("(x, y)", "[ %d, %d ]", x, y);
|
//ESP_LOGI("(x, y)", "[ %d, %d ]", x, y);
|
||||||
//get_joystick_xy(&buffer.x_axis, &buffer.y_axis);
|
//get_joystick_xy(&buffer.x_axis, &buffer.y_axis);
|
||||||
buffer.x_axis = x;
|
buffer.x_axis = x;
|
||||||
buffer.y_axis = y;
|
buffer.y_axis = y;
|
||||||
|
|
||||||
// Display brief summary of data being sent.
|
// Display brief summary of data being sent.
|
||||||
ESP_LOGI(TAG, "Joystick (x,y) position ( %d, %d )", buffer.x_axis, buffer.y_axis);
|
//ESP_LOGI(TAG, "Joystick (x,y) position ( %d, %d )", buffer.x_axis, buffer.y_axis);
|
||||||
ESP_LOGI(TAG, "pcm 1, pcm 2 [ 0x%04X, 0x%04X ]", (uint8_t)buffer.motor1_rpm_pcm, (uint8_t)buffer.motor2_rpm_pcm);
|
//ESP_LOGI(TAG, "pcm 1, pcm 2 [ 0x%04X, 0x%04X ]", (uint8_t)buffer.motor1_rpm_pcm, (uint8_t)buffer.motor2_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);
|
//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));
|
||||||
@@ -116,8 +116,8 @@ void sendData (void) {
|
|||||||
ESP_LOGE("ESP-NOW", "Error sending data! Error code: 0x%04X", result);
|
ESP_LOGE("ESP-NOW", "Error sending data! Error code: 0x%04X", result);
|
||||||
deletePeer();
|
deletePeer();
|
||||||
}
|
}
|
||||||
else
|
//else
|
||||||
ESP_LOGW("ESP-NOW", "Data was sent.");
|
//ESP_LOGW("ESP-NOW", "Data was sent.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Continous, periodic task that sends data.
|
// Continous, periodic task that sends data.
|
||||||
|
Reference in New Issue
Block a user