mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-08-07 13:57:17 +00:00
Compare commits
59 Commits
6fff0e1055
...
c0e15bf9c1
Author | SHA1 | Date | |
---|---|---|---|
c0e15bf9c1 | |||
c3a0a1aba1 | |||
0e6d6de77a | |||
8250d90297 | |||
ac898d87f8 | |||
aa6a024b5a | |||
3475bb6d3a | |||
ecd3a74869 | |||
48017439f6 | |||
b4bc1a0360 | |||
988020c3fe | |||
a59c651f2c | |||
74475f1980 | |||
f898891628 | |||
d7c9fd10c1 | |||
8fc7a729cb | |||
da12b6f784 | |||
926ef79bcc | |||
eae03cdac6 | |||
f4362b7d35 | |||
b957d9284d | |||
993cb0fa2d | |||
6143703be0 | |||
39356835ad | |||
a2fd5ebab7 | |||
bcd8893a08 | |||
4ca0ec3df8 | |||
ad95dc15e2 | |||
b0c3328cf8 | |||
5aad0c95a0 | |||
377ace0791 | |||
ea3a37e0a6 | |||
9a769acdc6 | |||
7096eb1ace | |||
69e761823f | |||
ab10810946 | |||
fee233aace | |||
3748a4852c | |||
53ebd3614e | |||
9711f000dd | |||
28294a7ccc | |||
13143f20a0 | |||
e868f318fe | |||
1063f86f90 | |||
5e7ab73943 | |||
4dc1edecb4 | |||
55e8d79304 | |||
9fe855f352 | |||
de49ab9ce5 | |||
e33ea6776d | |||
1f16114102 | |||
14740ea14e | |||
8b746c6fed | |||
146f78f423 | |||
c272efe503 | |||
c764cfba3c | |||
7ee4d80d83 | |||
df4a1fc7b3 | |||
2eb72112e4 |
@@ -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
@@ -1 +1 @@
|
|||||||
3dd9b66b288755c1d402163a30961f427596b63d
|
0e6d6de77a244ec1fec17667d7cdc02e3c368d91
|
||||||
|
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -103,3 +103,21 @@
|
|||||||
2559 2875 1754393320199842446 /home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot/build/bootloader/.bin_timestamp 6299e5a161707161
|
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 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
|
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
@@ -907,7 +907,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"directory": "/home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot/build",
|
"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",
|
"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"
|
"output": "esp-idf/esp_app_format/CMakeFiles/__idf_esp_app_format.dir/esp_app_desc.c.obj"
|
||||||
},
|
},
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"version": "1.2",
|
"version": "1.2",
|
||||||
"project_name": "ESP-IDF_Robot",
|
"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",
|
"project_path": "/home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot",
|
||||||
"idf_path": "/home/alex/esp/v5.4.1/esp-idf",
|
"idf_path": "/home/alex/esp/v5.4.1/esp-idf",
|
||||||
"build_dir": "/home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot/build",
|
"build_dir": "/home/alex/MyProjects/ESP-Nodes/ESP-IDF_Robot/build",
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
Updated: Jan 10, 2025
|
Updated: Jan 10, 2025
|
||||||
Jun 26, 2025
|
Jun 26, 2025
|
||||||
Jul 26, 2025 (ESP-IDF + MQTT + WiFi)
|
Jul 26, 2025 (ESP-IDF + MQTT + WiFi)
|
||||||
|
Aug 6 , 2025 Continous interpolation of joystick x- and y- values
|
||||||
|
|
||||||
built-in LED GPIO: 10
|
built-in LED GPIO: 10
|
||||||
build-in push button GPIO: 3
|
build-in push button GPIO: 3
|
||||||
|
@@ -18,18 +18,16 @@
|
|||||||
|
|
||||||
//static const char *TAG = "ESP IDF Robot"
|
//static const char *TAG = "ESP IDF Robot"
|
||||||
struct motors_rpm m;
|
struct motors_rpm m;
|
||||||
|
|
||||||
|
|
||||||
static int adc_raw[2][10];
|
static int adc_raw[2][10];
|
||||||
static int voltage[2][10];
|
static int voltage[2][10];
|
||||||
static int s = 0, sample = 5, x = 0, y = 0, x_sum = 0, y_sum = 0;
|
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;
|
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 interpolate_raw_val (int raw);
|
||||||
static int rescale_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));
|
ESP_ERROR_CHECK(adc_oneshot_config_channel(adc1_handle, ADC1_CHAN1, &config));
|
||||||
|
|
||||||
//-------------ADC1 Calibration Init---------------//
|
//-------------ADC1 Calibration Init---------------//
|
||||||
|
|
||||||
adc1_cali_chan0_handle = NULL;
|
adc1_cali_chan0_handle = NULL;
|
||||||
adc1_cali_chan1_handle = NULL;
|
adc1_cali_chan1_handle = NULL;
|
||||||
do_calibration1_chan0 = adc_calibration_init(ADC_UNIT_1, ADC1_CHAN0, ADC_ATTEN, &adc1_cali_chan0_handle);
|
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!
|
// IMPORTANT: x and y values correspod to the PWM!
|
||||||
static void update_pwm (int rc_x, int rc_y) {
|
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));
|
x = check_motor_pcm(rescale_raw_val(rc_x));
|
||||||
y = check_motor_pcm(rescale_raw_val(rc_y));
|
y = check_motor_pcm(rescale_raw_val(rc_y));
|
||||||
//ESP_LOGI("x,y", "( %d, %d ) [ %d, %d] ", rc_x, rc_y, x, 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) (+, -)
|
||||||
(-, -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
|
// All forward directions
|
||||||
if (y >= 1500) {
|
if (y >= 1500) {
|
||||||
m.motor1_rpm_pcm = (y - x); // Left side motors, forward
|
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
|
// ROTATIONS
|
||||||
// Rotate right
|
// Rotate right
|
||||||
if ((y < 1500) && (y > 1500)) && (x > 8000) {
|
if ((y < 1500) && (y > 1500) && (x > 8000)) {
|
||||||
m.motor1_rpm_pcm = (y - x);
|
m.motor1_rpm_pcm = (y - x);
|
||||||
m.motor2_rpm_pcm = 0;
|
m.motor2_rpm_pcm = 0;
|
||||||
m.motor3_rpm_pcm = -(y - x);
|
m.motor3_rpm_pcm = -(y - x);
|
||||||
m.motor4_rpm_pcm = 0;
|
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.motor1_rpm_pcm = 0;
|
||||||
m.motor2_rpm_pcm = (y + x);
|
m.motor2_rpm_pcm = (y + x);
|
||||||
m.motor3_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
|
// Turn Left
|
||||||
if (x == 8190 && y == -8190) {
|
if (x == 8190 && y == -8190) {
|
||||||
m.motor1_rpm_pcm = 6172;
|
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.motor2_rpm_pcm = 0;
|
||||||
m.motor3_rpm_pcm = 0;
|
m.motor3_rpm_pcm = 0;
|
||||||
m.motor4_rpm_pcm = 0;
|
m.motor4_rpm_pcm = 0;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
ledc_set_duty(MTR_MODE, MTR_FRONT_LEFT, m.motor1_rpm_pcm);
|
ledc_set_duty(MTR_MODE, MTR_FRONT_LEFT, m.motor1_rpm_pcm);
|
||||||
ledc_update_duty(MTR_MODE, MTR_FRONT_LEFT);
|
ledc_update_duty(MTR_MODE, MTR_FRONT_LEFT);
|
||||||
ledc_set_duty(MTR_MODE, MTR_FRONT_RIGHT, m.motor2_rpm_pcm);
|
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);
|
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_CHAN0, &adc_raw[0][0]));
|
||||||
ESP_ERROR_CHECK(adc_oneshot_read(adc1_handle, ADC1_CHAN1, &adc_raw[0][1]));
|
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_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]);
|
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)
|
static bool adc_calibration_init(adc_unit_t unit, adc_channel_t channel, adc_atten_t atten, adc_cali_handle_t *out_handle)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user