59 Commits

Author SHA1 Message Date
c0e15bf9c1 pcm 2025-08-06 04:36:07 -04:00
c3a0a1aba1 pcm 2025-08-06 04:36:02 -04:00
0e6d6de77a pcm 2025-08-06 04:35:56 -04:00
8250d90297 pcm 2025-08-06 04:35:34 -04:00
ac898d87f8 pcm 2025-08-06 04:34:45 -04:00
aa6a024b5a pcm 2025-08-06 04:34:35 -04:00
3475bb6d3a pcm 2025-08-06 04:33:56 -04:00
ecd3a74869 pcm 2025-08-06 04:33:35 -04:00
48017439f6 pcm 2025-08-06 04:33:18 -04:00
b4bc1a0360 pcm 2025-08-06 04:33:02 -04:00
988020c3fe pcm 2025-08-06 04:32:51 -04:00
a59c651f2c pcm 2025-08-06 04:32:29 -04:00
74475f1980 pcm 2025-08-06 04:31:46 -04:00
f898891628 pcm 2025-08-06 04:30:57 -04:00
d7c9fd10c1 pcm 2025-08-06 04:30:51 -04:00
8fc7a729cb pcm 2025-08-06 04:30:46 -04:00
da12b6f784 pcm 2025-08-06 04:30:41 -04:00
926ef79bcc pcm 2025-08-06 04:30:30 -04:00
eae03cdac6 pcm 2025-08-06 04:30:24 -04:00
f4362b7d35 pcm 2025-08-06 04:30:19 -04:00
b957d9284d pcm 2025-08-06 04:30:08 -04:00
993cb0fa2d pcm 2025-08-06 04:29:27 -04:00
6143703be0 pcm 2025-08-06 04:29:21 -04:00
39356835ad pcm 2025-08-06 04:29:15 -04:00
a2fd5ebab7 pcm 2025-08-06 04:29:05 -04:00
bcd8893a08 pcm 2025-08-06 04:28:10 -04:00
4ca0ec3df8 pcm 2025-08-06 04:28:05 -04:00
ad95dc15e2 pcm 2025-08-06 04:27:59 -04:00
b0c3328cf8 pcm 2025-08-06 04:27:26 -04:00
5aad0c95a0 pcm 2025-08-06 04:27:21 -04:00
377ace0791 pcm 2025-08-06 04:27:15 -04:00
ea3a37e0a6 pcm 2025-08-06 04:26:54 -04:00
9a769acdc6 pcm 2025-08-06 04:26:48 -04:00
7096eb1ace pcm 2025-08-06 04:26:43 -04:00
69e761823f pcm 2025-08-06 04:26:21 -04:00
ab10810946 pcm 2025-08-06 04:25:16 -04:00
fee233aace pcm 2025-08-06 04:25:10 -04:00
3748a4852c pcm 2025-08-06 04:25:05 -04:00
53ebd3614e pcm 2025-08-06 04:24:48 -04:00
9711f000dd pcm 2025-08-06 04:24:43 -04:00
28294a7ccc pcm 2025-08-06 04:24:21 -04:00
13143f20a0 pcm 2025-08-06 04:24:16 -04:00
e868f318fe pcm 2025-08-06 04:24:10 -04:00
1063f86f90 pcm 2025-08-06 04:24:05 -04:00
5e7ab73943 pcm 2025-08-06 04:23:38 -04:00
4dc1edecb4 pcm 2025-08-06 04:23:32 -04:00
55e8d79304 pcm 2025-08-06 04:23:27 -04:00
9fe855f352 pcm 2025-08-06 04:23:22 -04:00
de49ab9ce5 pcm 2025-08-06 04:23:00 -04:00
e33ea6776d pcm 2025-08-06 04:22:54 -04:00
1f16114102 pcm 2025-08-06 04:22:49 -04:00
14740ea14e pcm 2025-08-06 04:22:43 -04:00
8b746c6fed pcm 2025-08-06 04:22:21 -04:00
146f78f423 pcm 2025-08-06 04:22:16 -04:00
c272efe503 pcm 2025-08-06 04:22:11 -04:00
c764cfba3c pcm 2025-08-06 04:22:05 -04:00
7ee4d80d83 pcm 2025-08-06 04:21:16 -04:00
df4a1fc7b3 pcm 2025-08-06 04:21:11 -04:00
2eb72112e4 pwm 2025-08-06 04:20:17 -04:00
17 changed files with 9286 additions and 11064 deletions

View File

@@ -1 +1 @@
a17681695fbd59172dea7a5e3fb2dce5 /home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot/build/ESP-IDF_Robot.bin
97c2a2f37ea8f69cb78b005b8f6ed8d3 /home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot/build/ESP-IDF_Robot.bin

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -1 +1 @@
3dd9b66b288755c1d402163a30961f427596b63d
0e6d6de77a244ec1fec17667d7cdc02e3c368d91

File diff suppressed because it is too large Load Diff

View File

@@ -103,3 +103,21 @@
2559 2875 1754393320199842446 /home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot/build/bootloader/.bin_timestamp 6299e5a161707161
2875 2959 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size 6c300279c7653025
2875 2959 0 /home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size 6c300279c7653025
9 46 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size 6c300279c7653025
9 46 0 /home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size 6c300279c7653025
6 39 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size 6c300279c7653025
6 39 0 /home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size 6c300279c7653025
6 44 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size 6c300279c7653025
6 44 0 /home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size 6c300279c7653025
6 41 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size 6c300279c7653025
6 41 0 /home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size 6c300279c7653025
5 38 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size 6c300279c7653025
5 38 0 /home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size 6c300279c7653025
5 35 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size 6c300279c7653025
5 35 0 /home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size 6c300279c7653025
5 37 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size 6c300279c7653025
5 37 0 /home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size 6c300279c7653025
6 43 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size 6c300279c7653025
6 43 0 /home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size 6c300279c7653025
6 38 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size 6c300279c7653025
6 38 0 /home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size 6c300279c7653025

File diff suppressed because one or more lines are too long

View File

@@ -907,7 +907,7 @@
},
{
"directory": "/home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot/build",
"command": "/home/alex/.espressif/tools/riscv32-esp-elf/esp-14.2.0_20241119/riscv32-esp-elf/bin/riscv32-esp-elf-gcc -DESP_PLATFORM -DIDF_VER=\\\"v5.4.1-dirty\\\" -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DSOC_XTAL_FREQ_MHZ=CONFIG_XTAL_FREQ -D_GLIBCXX_HAVE_POSIX_SEMAPHORE -D_GLIBCXX_USE_POSIX_SEMAPHORE -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -D PROJECT_NAME=\\\"ESP-IDF_Robot\\\" -DPROJECT_VER=\\\"ESP32-Node_Switch-v2.7-9218-g3d\\\" -I/home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot/build/config -I/home/alex/esp/v5.4.1/esp-idf/components/esp_app_format/include -I/home/alex/esp/v5.4.1/esp-idf/components/newlib/platform_include -I/home/alex/esp/v5.4.1/esp-idf/components/freertos/config/include -I/home/alex/esp/v5.4.1/esp-idf/components/freertos/config/include/freertos -I/home/alex/esp/v5.4.1/esp-idf/components/freertos/config/riscv/include -I/home/alex/esp/v5.4.1/esp-idf/components/freertos/FreeRTOS-Kernel/include -I/home/alex/esp/v5.4.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/riscv/include -I/home/alex/esp/v5.4.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos -I/home/alex/esp/v5.4.1/esp-idf/components/freertos/esp_additions/include -I/home/alex/esp/v5.4.1/esp-idf/components/esp_hw_support/include -I/home/alex/esp/v5.4.1/esp-idf/components/esp_hw_support/include/soc -I/home/alex/esp/v5.4.1/esp-idf/components/esp_hw_support/include/soc/esp32c3 -I/home/alex/esp/v5.4.1/esp-idf/components/esp_hw_support/dma/include -I/home/alex/esp/v5.4.1/esp-idf/components/esp_hw_support/ldo/include -I/home/alex/esp/v5.4.1/esp-idf/components/esp_hw_support/debug_probe/include -I/home/alex/esp/v5.4.1/esp-idf/components/esp_hw_support/port/esp32c3/. -I/home/alex/esp/v5.4.1/esp-idf/components/esp_hw_support/port/esp32c3/include -I/home/alex/esp/v5.4.1/esp-idf/components/heap/include -I/home/alex/esp/v5.4.1/esp-idf/components/heap/tlsf -I/home/alex/esp/v5.4.1/esp-idf/components/log/include -I/home/alex/esp/v5.4.1/esp-idf/components/soc/include -I/home/alex/esp/v5.4.1/esp-idf/components/soc/esp32c3 -I/home/alex/esp/v5.4.1/esp-idf/components/soc/esp32c3/include -I/home/alex/esp/v5.4.1/esp-idf/components/soc/esp32c3/register -I/home/alex/esp/v5.4.1/esp-idf/components/hal/platform_port/include -I/home/alex/esp/v5.4.1/esp-idf/components/hal/esp32c3/include -I/home/alex/esp/v5.4.1/esp-idf/components/hal/include -I/home/alex/esp/v5.4.1/esp-idf/components/esp_rom/include -I/home/alex/esp/v5.4.1/esp-idf/components/esp_rom/esp32c3/include -I/home/alex/esp/v5.4.1/esp-idf/components/esp_rom/esp32c3/include/esp32c3 -I/home/alex/esp/v5.4.1/esp-idf/components/esp_rom/esp32c3 -I/home/alex/esp/v5.4.1/esp-idf/components/esp_common/include -I/home/alex/esp/v5.4.1/esp-idf/components/esp_system/include -I/home/alex/esp/v5.4.1/esp-idf/components/esp_system/port/soc -I/home/alex/esp/v5.4.1/esp-idf/components/esp_system/port/include/riscv -I/home/alex/esp/v5.4.1/esp-idf/components/esp_system/port/include/private -I/home/alex/esp/v5.4.1/esp-idf/components/riscv/include -I/home/alex/esp/v5.4.1/esp-idf/components/lwip/include -I/home/alex/esp/v5.4.1/esp-idf/components/lwip/include/apps -I/home/alex/esp/v5.4.1/esp-idf/components/lwip/include/apps/sntp -I/home/alex/esp/v5.4.1/esp-idf/components/lwip/lwip/src/include -I/home/alex/esp/v5.4.1/esp-idf/components/lwip/port/include -I/home/alex/esp/v5.4.1/esp-idf/components/lwip/port/freertos/include -I/home/alex/esp/v5.4.1/esp-idf/components/lwip/port/esp32xx/include -I/home/alex/esp/v5.4.1/esp-idf/components/lwip/port/esp32xx/include/arch -I/home/alex/esp/v5.4.1/esp-idf/components/lwip/port/esp32xx/include/sys -march=rv32imc_zicsr_zifencei -fdiagnostics-color=always -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wextra -Wno-error=extra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -nostartfiles -Og -fno-shrink-wrap -fmacro-prefix-map=/home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot=. -fmacro-prefix-map=/home/alex/esp/v5.4.1/esp-idf=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -std=gnu17 -Wno-old-style-declaration -o esp-idf/esp_app_format/CMakeFiles/__idf_esp_app_format.dir/esp_app_desc.c.obj -c /home/alex/esp/v5.4.1/esp-idf/components/esp_app_format/esp_app_desc.c",
"command": "/home/alex/.espressif/tools/riscv32-esp-elf/esp-14.2.0_20241119/riscv32-esp-elf/bin/riscv32-esp-elf-gcc -DESP_PLATFORM -DIDF_VER=\\\"v5.4.1-dirty\\\" -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DSOC_XTAL_FREQ_MHZ=CONFIG_XTAL_FREQ -D_GLIBCXX_HAVE_POSIX_SEMAPHORE -D_GLIBCXX_USE_POSIX_SEMAPHORE -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -D PROJECT_NAME=\\\"ESP-IDF_Robot\\\" -DPROJECT_VER=\\\"ESP32-Node_Switch-v2.7-9286-g0e\\\" -I/home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot/build/config -I/home/alex/esp/v5.4.1/esp-idf/components/esp_app_format/include -I/home/alex/esp/v5.4.1/esp-idf/components/newlib/platform_include -I/home/alex/esp/v5.4.1/esp-idf/components/freertos/config/include -I/home/alex/esp/v5.4.1/esp-idf/components/freertos/config/include/freertos -I/home/alex/esp/v5.4.1/esp-idf/components/freertos/config/riscv/include -I/home/alex/esp/v5.4.1/esp-idf/components/freertos/FreeRTOS-Kernel/include -I/home/alex/esp/v5.4.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/riscv/include -I/home/alex/esp/v5.4.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos -I/home/alex/esp/v5.4.1/esp-idf/components/freertos/esp_additions/include -I/home/alex/esp/v5.4.1/esp-idf/components/esp_hw_support/include -I/home/alex/esp/v5.4.1/esp-idf/components/esp_hw_support/include/soc -I/home/alex/esp/v5.4.1/esp-idf/components/esp_hw_support/include/soc/esp32c3 -I/home/alex/esp/v5.4.1/esp-idf/components/esp_hw_support/dma/include -I/home/alex/esp/v5.4.1/esp-idf/components/esp_hw_support/ldo/include -I/home/alex/esp/v5.4.1/esp-idf/components/esp_hw_support/debug_probe/include -I/home/alex/esp/v5.4.1/esp-idf/components/esp_hw_support/port/esp32c3/. -I/home/alex/esp/v5.4.1/esp-idf/components/esp_hw_support/port/esp32c3/include -I/home/alex/esp/v5.4.1/esp-idf/components/heap/include -I/home/alex/esp/v5.4.1/esp-idf/components/heap/tlsf -I/home/alex/esp/v5.4.1/esp-idf/components/log/include -I/home/alex/esp/v5.4.1/esp-idf/components/soc/include -I/home/alex/esp/v5.4.1/esp-idf/components/soc/esp32c3 -I/home/alex/esp/v5.4.1/esp-idf/components/soc/esp32c3/include -I/home/alex/esp/v5.4.1/esp-idf/components/soc/esp32c3/register -I/home/alex/esp/v5.4.1/esp-idf/components/hal/platform_port/include -I/home/alex/esp/v5.4.1/esp-idf/components/hal/esp32c3/include -I/home/alex/esp/v5.4.1/esp-idf/components/hal/include -I/home/alex/esp/v5.4.1/esp-idf/components/esp_rom/include -I/home/alex/esp/v5.4.1/esp-idf/components/esp_rom/esp32c3/include -I/home/alex/esp/v5.4.1/esp-idf/components/esp_rom/esp32c3/include/esp32c3 -I/home/alex/esp/v5.4.1/esp-idf/components/esp_rom/esp32c3 -I/home/alex/esp/v5.4.1/esp-idf/components/esp_common/include -I/home/alex/esp/v5.4.1/esp-idf/components/esp_system/include -I/home/alex/esp/v5.4.1/esp-idf/components/esp_system/port/soc -I/home/alex/esp/v5.4.1/esp-idf/components/esp_system/port/include/riscv -I/home/alex/esp/v5.4.1/esp-idf/components/esp_system/port/include/private -I/home/alex/esp/v5.4.1/esp-idf/components/riscv/include -I/home/alex/esp/v5.4.1/esp-idf/components/lwip/include -I/home/alex/esp/v5.4.1/esp-idf/components/lwip/include/apps -I/home/alex/esp/v5.4.1/esp-idf/components/lwip/include/apps/sntp -I/home/alex/esp/v5.4.1/esp-idf/components/lwip/lwip/src/include -I/home/alex/esp/v5.4.1/esp-idf/components/lwip/port/include -I/home/alex/esp/v5.4.1/esp-idf/components/lwip/port/freertos/include -I/home/alex/esp/v5.4.1/esp-idf/components/lwip/port/esp32xx/include -I/home/alex/esp/v5.4.1/esp-idf/components/lwip/port/esp32xx/include/arch -I/home/alex/esp/v5.4.1/esp-idf/components/lwip/port/esp32xx/include/sys -march=rv32imc_zicsr_zifencei -fdiagnostics-color=always -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wextra -Wno-error=extra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -nostartfiles -Og -fno-shrink-wrap -fmacro-prefix-map=/home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot=. -fmacro-prefix-map=/home/alex/esp/v5.4.1/esp-idf=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -std=gnu17 -Wno-old-style-declaration -o esp-idf/esp_app_format/CMakeFiles/__idf_esp_app_format.dir/esp_app_desc.c.obj -c /home/alex/esp/v5.4.1/esp-idf/components/esp_app_format/esp_app_desc.c",
"file": "/home/alex/esp/v5.4.1/esp-idf/components/esp_app_format/esp_app_desc.c",
"output": "esp-idf/esp_app_format/CMakeFiles/__idf_esp_app_format.dir/esp_app_desc.c.obj"
},

View File

@@ -1,7 +1,7 @@
{
"version": "1.2",
"project_name": "ESP-IDF_Robot",
"project_version": "ESP32-Node_Switch-v2.7-9218-g3dd9b66b2-dirty",
"project_version": "ESP32-Node_Switch-v2.7-9286-g0e6d6de77-dirty",
"project_path": "/home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot",
"idf_path": "/home/alex/esp/v5.4.1/esp-idf",
"build_dir": "/home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot/build",

View File

@@ -7,6 +7,7 @@
Updated: Jan 10, 2025
Jun 26, 2025
Jul 26, 2025 (ESP-IDF + MQTT + WiFi)
Aug 6 , 2025 Continous interpolation of joystick x- and y- values
built-in LED GPIO: 10
build-in push button GPIO: 3

View File

@@ -18,18 +18,16 @@
//static const char *TAG = "ESP IDF Robot"
struct motors_rpm m;
static int adc_raw[2][10];
static int voltage[2][10];
static int s = 0, sample = 5, x = 0, y = 0, x_sum = 0, y_sum = 0;
static bool adc_calibration_init(adc_unit_t unit, adc_channel_t channel, adc_atten_t atten, adc_cali_handle_t *out_handle);
static void adc_calibration_deinit(adc_cali_handle_t handle);
adc_cali_handle_t adc1_cali_chan0_handle, adc1_cali_chan1_handle;
adc_oneshot_unit_handle_t adc1_handle;
bool do_calibration1_chan0, do_calibration1_chan1;
adc_cali_handle_t adc1_cali_chan0_handle, adc1_cali_chan1_handle;
adc_oneshot_unit_handle_t adc1_handle;
static bool adc_calibration_init(adc_unit_t unit, adc_channel_t channel, adc_atten_t atten, adc_cali_handle_t *out_handle);
static void adc_calibration_deinit(adc_cali_handle_t handle);
static int interpolate_raw_val (int raw);
static int rescale_raw_val (int raw);
@@ -49,7 +47,6 @@ static esp_err_t rc_adc_init (void) {
ESP_ERROR_CHECK(adc_oneshot_config_channel(adc1_handle, ADC1_CHAN1, &config));
//-------------ADC1 Calibration Init---------------//
adc1_cali_chan0_handle = NULL;
adc1_cali_chan1_handle = NULL;
do_calibration1_chan0 = adc_calibration_init(ADC_UNIT_1, ADC1_CHAN0, ADC_ATTEN, &adc1_cali_chan0_handle);
@@ -72,7 +69,6 @@ static int check_motor_pcm(int x) {
// IMPORTANT: x and y values correspod to the PWM!
static void update_pwm (int rc_x, int rc_y) {
//m.motor1_rpm_pcm = check_motor_pcm(rescale_raw_val(x));
x = check_motor_pcm(rescale_raw_val(rc_x));
y = check_motor_pcm(rescale_raw_val(rc_y));
//ESP_LOGI("x,y", "( %d, %d ) [ %d, %d] ", rc_x, rc_y, x, y);
@@ -95,10 +91,11 @@ static void update_pwm (int rc_x, int rc_y) {
(-, +) (0, 0) (+, -)
(-, -0) (-, -) (-0, -)
if (1024 < x < 2048 && 1024 < y < 2048) {
}*/
if (1024 < x < 2048 && 1024 < y < 2048) {}
*/
// Smooth update
// ADDED ON AUG 6, 2025
// CONTINOUS UPDATE
// All forward directions
if (y >= 1500) {
m.motor1_rpm_pcm = (y - x); // Left side motors, forward
@@ -115,13 +112,13 @@ static void update_pwm (int rc_x, int rc_y) {
}
// ROTATIONS
// Rotate right
if ((y < 1500) && (y > 1500)) && (x > 8000) {
if ((y < 1500) && (y > 1500) && (x > 8000)) {
m.motor1_rpm_pcm = (y - x);
m.motor2_rpm_pcm = 0;
m.motor3_rpm_pcm = -(y - x);
m.motor4_rpm_pcm = 0;
}
if ((y < 1500) && (y > 1500)) && (x < 8000) {
if ((y < 1500) && (y > 1500) && (x < 8000)) {
m.motor1_rpm_pcm = 0;
m.motor2_rpm_pcm = (y + x);
m.motor3_rpm_pcm = -(y - x);
@@ -129,6 +126,7 @@ static void update_pwm (int rc_x, int rc_y) {
}
// -------------
/*
// Turn Left
if (x == 8190 && y == -8190) {
m.motor1_rpm_pcm = 6172;
@@ -196,7 +194,8 @@ static void update_pwm (int rc_x, int rc_y) {
m.motor2_rpm_pcm = 0;
m.motor3_rpm_pcm = 0;
m.motor4_rpm_pcm = 0;
}
}*/
ledc_set_duty(MTR_MODE, MTR_FRONT_LEFT, m.motor1_rpm_pcm);
ledc_update_duty(MTR_MODE, MTR_FRONT_LEFT);
ledc_set_duty(MTR_MODE, MTR_FRONT_RIGHT, m.motor2_rpm_pcm);
@@ -208,7 +207,7 @@ static void update_pwm (int rc_x, int rc_y) {
ledc_update_duty(MTR_MODE, MTR_FRONT_RIGHT_REV);
}
static void rc_get_raw_data() {
/*static void rc_get_raw_data() {
ESP_ERROR_CHECK(adc_oneshot_read(adc1_handle, ADC1_CHAN0, &adc_raw[0][0]));
ESP_ERROR_CHECK(adc_oneshot_read(adc1_handle, ADC1_CHAN1, &adc_raw[0][1]));
@@ -292,7 +291,7 @@ static void rc_get_raw_data() {
ESP_ERROR_CHECK(adc_cali_raw_to_voltage(adc1_cali_chan1_handle, adc_raw[0][1], &voltage[0][1]));
ESP_LOGI("ESP IDF Robot", "ADC%d Channel[%d] Cali Voltage: %d mV", ADC_UNIT_1 + 1, ADC1_CHAN1, voltage[0][1]);
}
}
}*/
static bool adc_calibration_init(adc_unit_t unit, adc_channel_t channel, adc_atten_t atten, adc_cali_handle_t *out_handle)
{