mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-10-01 17:25:46 +00:00
ESP-NOW Transmitter comments
This commit is contained in:
@@ -13,6 +13,18 @@ static int x, y; // Joystick x and y positions
|
|||||||
static adc_oneshot_unit_handle_t adc_xy_handle;
|
static adc_oneshot_unit_handle_t adc_xy_handle;
|
||||||
static sensors_data_t buffer;
|
static sensors_data_t buffer;
|
||||||
|
|
||||||
|
// Struct holding sensors values
|
||||||
|
typedef struct {
|
||||||
|
uint16_t crc; // CRC16 value of ESPNOW data
|
||||||
|
int x_axis; // Joystick x-position
|
||||||
|
int y_axis; // Joystick y-position
|
||||||
|
bool nav_bttn; // Joystick push button
|
||||||
|
uint8_t motor1_rpm_pcm; // PWMs for 4 DC motors
|
||||||
|
uint8_t motor2_rpm_pcm;
|
||||||
|
uint8_t motor3_rpm_pcm;
|
||||||
|
uint8_t motor4_rpm_pcm;
|
||||||
|
} __attribute__((packed)) sensors_data_t;
|
||||||
|
|
||||||
static esp_err_t joystick_adc_init() {
|
static esp_err_t joystick_adc_init() {
|
||||||
adc_oneshot_unit_init_cfg_t adc_init_config_xy = {
|
adc_oneshot_unit_init_cfg_t adc_init_config_xy = {
|
||||||
.unit_id = ADC_UNIT_1,
|
.unit_id = ADC_UNIT_1,
|
||||||
|
Reference in New Issue
Block a user