mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-08-23 22:27:38 +00:00
14 lines
279 B
C
14 lines
279 B
C
#ifndef JOYSTICK_H
|
|
#define JOYSTICK_H
|
|
|
|
#include "driver/adc.h"
|
|
#include "esp_adc/adc_oneshot.h"
|
|
|
|
static uint8_t x, y;
|
|
adc_oneshot_unit_handle_t adc1_x_handle;
|
|
|
|
static void joystick_get_raw_xy() {
|
|
ESP_ERROR_CHECK(adc_oneshot_read(adc1_x_handle, ADC1_CHANNEL_0, &x));
|
|
}
|
|
|
|
#endif |