This commit is contained in:
2025-01-05 02:14:45 -05:00
parent fe7d7fcb2d
commit 99a6b1d138
3 changed files with 7 additions and 7 deletions

View File

View File

@@ -1 +1 @@
f8cf74592c494d85404466ebec3035cf452b2ad6
fe7d7fcb2d83fafc92ff8e1755b15ad4c83c0ff6

View File

@@ -98,15 +98,15 @@ void sendData (void) {
buffer.motor4_rpm_pcm = 0;
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);
buffer.x_axis = x;
buffer.y_axis = y;
// 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, "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, "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 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)
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);
deletePeer();
}
else
ESP_LOGW("ESP-NOW", "Data was sent.");
//else
//ESP_LOGW("ESP-NOW", "Data was sent.");
}
// Continous, periodic task that sends data.