mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-08-31 23:56:50 +00:00
ESP-NOW Transmitter
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user