ESP-NOW Transmitter

This commit is contained in:
2025-06-18 01:21:59 -04:00
parent f900ead7e8
commit 9ba576e564
6 changed files with 5 additions and 23 deletions

View File

@@ -1 +1 @@
ref: refs/heads/main 4c2820d377d1375e787bcef612f0c32c1427d183

View File

@@ -18,7 +18,7 @@ set(HEAD_HASH)
file(READ "/home/abobkov/MyProjects/ESP-Nodes/ESP32-IDF_ESPNOW-Transmitter/build/CMakeFiles/git-data/HEAD" HEAD_CONTENTS LIMIT 1024) file(READ "/home/abobkov/MyProjects/ESP-Nodes/ESP32-IDF_ESPNOW-Transmitter/build/CMakeFiles/git-data/HEAD" HEAD_CONTENTS LIMIT 1024)
string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
set(GIT_DIR "/home/abobkov/MyProjects/ESP-Nodes/.git") set(GIT_DIR "/home/abobkov/esp/v5.4.1/esp-idf/.git")
# handle git-worktree # handle git-worktree
if(EXISTS "${GIT_DIR}/commondir") if(EXISTS "${GIT_DIR}/commondir")
file(READ "${GIT_DIR}/commondir" GIT_DIR_NEW LIMIT 1024) file(READ "${GIT_DIR}/commondir" GIT_DIR_NEW LIMIT 1024)

View File

@@ -1 +1 @@
abcfede450517ab557191e4e8820b3cd4ba7e368 4c2820d377d1375e787bcef612f0c32c1427d183

View File

@@ -44,26 +44,7 @@ adc_oneshot_unit_handle_t adc_xy_handle;
sensors_data_t buffer; sensors_data_t buffer;
//static sensors_data_t buffer; //static sensors_data_t buffer;
esp_err_t joystick_adc_init(void) {
adc_oneshot_unit_init_cfg_t adc_init_config_xy = {
.unit_id = ADC_UNIT_1,
.ulp_mode = ADC_ULP_MODE_DISABLE,
};
ESP_ERROR_CHECK(adc_oneshot_new_unit(&adc_init_config_xy, &adc_xy_handle));
adc_oneshot_chan_cfg_t config_x = {
.bitwidth = SOC_ADC_DIGI_MAX_BITWIDTH,
.atten = ADC_ATTEN_DB_12,
};
adc_oneshot_chan_cfg_t config_y = {
.bitwidth = SOC_ADC_DIGI_MAX_BITWIDTH,
.atten = ADC_ATTEN_DB_12,
};
ESP_ERROR_CHECK(adc_oneshot_config_channel(adc_xy_handle, ADC_CHANNEL_0, &config_x));
ESP_ERROR_CHECK(adc_oneshot_config_channel(adc_xy_handle, ADC_CHANNEL_1, &config_y));
return ESP_OK;
}
void joystick_show_raw_xy() { void joystick_show_raw_xy() {
ESP_ERROR_CHECK(adc_oneshot_read(adc_xy_handle, ADC_CHANNEL_0, &x)); ESP_ERROR_CHECK(adc_oneshot_read(adc_xy_handle, ADC_CHANNEL_0, &x));

View File

@@ -1,5 +1,6 @@
#include "esp_adc/adc_oneshot.h" #include "esp_adc/adc_oneshot.h"
#include "esp/err.h" #include "esp_log.h"
#include "esp_err.h"
esp_err_t joystick_adc_init(void) { esp_err_t joystick_adc_init(void) {
adc_oneshot_unit_init_cfg_t adc_init_config_xy = { adc_oneshot_unit_init_cfg_t adc_init_config_xy = {