ESP-NOW Transmitter

This commit is contained in:
2025-06-17 22:05:23 -04:00
parent 7e551158e7
commit dffde2b955

View File

@@ -1,4 +1,5 @@
#include "sensors_data.h"
#include "driver/adc.h"
static sensors_data_t buffer;
@@ -9,6 +10,11 @@ int convert_axis_to_pwm(int axis_value) {
return (axis_value * 255) / 4095;
}
void get_joystick_xy_axis(int *x_axis, int *y_axis) {
ESP_ERROR_CHECK(adc_oneshot_read(adc_xy_handle, ADC1_CHANNEL_0, x_axis));
ESP_ERROR_CHECK(adc_oneshot_read(adc_xy_handle, ADC1_CHANNEL_1, y_axis));
}
void sendRawData(void) {
buffer.crc = 0;