diff --git a/ESP-IDF_Robot/tutorial/docs/build/simplepdf/.buildinfo b/ESP-IDF_Robot/tutorial/docs/build/simplepdf/.buildinfo index bbf9f9c20..71d283139 100644 --- a/ESP-IDF_Robot/tutorial/docs/build/simplepdf/.buildinfo +++ b/ESP-IDF_Robot/tutorial/docs/build/simplepdf/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file records the configuration used when building these files. When it is not found, a full rebuild will be done. -config: e22baa48f9e7069a3e9b5dc9ddc22300 +config: 796e17b103e65790f3a1610a89da3193 tags: 62a1e7829a13fc7881b6498c52484ec0 diff --git a/ESP-IDF_Robot/tutorial/docs/build/simplepdf/esp-idf_espnow_rc-car.pdf b/ESP-IDF_Robot/tutorial/docs/build/simplepdf/esp-idf_espnow_rc-car.pdf index 291cf3d85..b07c2d0ec 100644 Binary files a/ESP-IDF_Robot/tutorial/docs/build/simplepdf/esp-idf_espnow_rc-car.pdf and b/ESP-IDF_Robot/tutorial/docs/build/simplepdf/esp-idf_espnow_rc-car.pdf differ diff --git a/ESP-IDF_Robot/tutorial/docs/build/simplepdf/index.html b/ESP-IDF_Robot/tutorial/docs/build/simplepdf/index.html index 8126a7e7e..b5e114e9f 100644 --- a/ESP-IDF_Robot/tutorial/docs/build/simplepdf/index.html +++ b/ESP-IDF_Robot/tutorial/docs/build/simplepdf/index.html @@ -725,7 +725,9 @@ left turn, the receiver translates the signal into 100% PWM on the left-side mot to pivot. The opposite occurs for a right turn, with 100% PWM on the right and 0% on the left, enabling precise directional control.
- The table below summarizes the reserved GPIOs. + The table below summarizes the reserved GPIOs. These GPIOs are hard-wired to the corresponding components, and hard-coded in the +corresponding functions. For example, the GPIOs 0 and 1 are hard-wired to the joystick x- and y- axis, respectively; and, hard-coded +to read analog values and store them in the corresponding x- and y- variables.
- The - - struct - - for storing motors PWM values. + The struct used to store motor PWM values is shown below. While the bitByteRider RC car can be effectively controlled using +just two PWM signals—one for each side—the structure is designed to hold four values, allowing room for future enhancements. This +forward-thinking design supports potential upgrades such as improved maneuverability, individual wheel control, or advanced driving +modes, making the system more adaptable and scalable for future development.
- The function for updating motors’ PWM values. + On the transmitter`` device, the PWM values for the DC motors are send to the receover using the following function. The variable + + receiver_mac + + stores the MAC address of the receiver device (ESP32-C3 bitBoard on the RC car).
- The onDataReceived() and onDataSent() are two call-back functions that get evoked on each corresponding event. -
-// Call-back for the event when data is being received
-void onDataReceived (uint8_t *mac_addr, uint8_t *data, uint8_t data_len) {
-
- buf = (sensors_data_t*)data; // Allocate memory for buffer to store data being received
- ESP_LOGW(TAG, "Data was received");
- ESP_LOGI(TAG, "x-axis: 0x%04x", buf->x_axis);
- ESP_LOGI(TAG, "x-axis: 0x%04x", buf->y_axis);
- ESP_LOGI(TAG, "PWM 1: 0x%04x", buf->motor1_rpm_pwm);
-}
-
-// Call-back for the event when data is being sent
-void onDataSent (uint8_t *mac_addr, esp_now_send_status_t status) {
- ESP_LOGW(TAG, "Packet send status: 0x%04X", status);
-}
-
- - The rc_send_data_task() function runs every 0.1 second to transmit the data to the receiver. + This function is invoked by a dedicated FreeRTOS task every 100 milliseconds, ensuring consistent and timely transmission of +control data to the receiver device. By leveraging FreeRTOS’s precise task scheduling, the system maintains low-latency +communication and predictable behavior—critical for real-time control in embedded applications.
+ As data is being sent, the function onDataSent() is called to check & display the status of the data transmission. +
+// Call-back for the event when data is being sent
+void onDataSent (uint8_t *mac_addr, esp_now_send_status_t status) {
+ ESP_LOGW(TAG, "Packet send status: 0x%04X", status);
+}
+
+... ... ...
+... ... ...
+
+ + On the receiver device, the data is saved in the variables by the call-back function onDataReceived(). +
+// Call-back for the event when data is being received
+void onDataReceived (uint8_t *mac_addr, uint8_t *data, uint8_t data_len) {
+
+ buf = (sensors_data_t*)data; // Allocate memory for buffer to store data being received
+ ESP_LOGW(TAG, "Data was received");
+ ESP_LOGI(TAG, "x-axis: 0x%04x", buf->x_axis);
+ ESP_LOGI(TAG, "x-axis: 0x%04x", buf->y_axis);
+ ESP_LOGI(TAG, "PWM 1: 0x%04x", buf->motor1_rpm_pwm);
+}
+
+ + The rc_send_data_task() function runs every 0.1 second to transmit the data to the receiver. +