mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-08-10 09:03:23 +00:00
ESP32-C3 RC
This commit is contained in:
@@ -69,6 +69,7 @@ static int check_motor_pcm(int x) {
|
||||
|
||||
static void rc_get_raw_data() {
|
||||
int sample = 0;
|
||||
int x = 0, y = 0;
|
||||
|
||||
ESP_ERROR_CHECK(adc_oneshot_read(adc1_handle, ADC1_CHAN0, &adc_raw[0][0]));
|
||||
ESP_ERROR_CHECK(adc_oneshot_read(adc1_handle, ADC1_CHAN1, &adc_raw[0][1]));
|
||||
@@ -80,8 +81,8 @@ static void rc_get_raw_data() {
|
||||
if (sample < 10)
|
||||
sample ++;
|
||||
else if (sample == 10) {
|
||||
int x = check_motor_pcm(rescale_raw_val(adc_raw[0][0]));
|
||||
int y = check_motor_pcm(rescale_raw_val(adc_raw[0][1]));
|
||||
x = check_motor_pcm(rescale_raw_val(adc_raw[0][0]));
|
||||
y = check_motor_pcm(rescale_raw_val(adc_raw[0][1]));
|
||||
}
|
||||
else {
|
||||
sample = 0;
|
||||
|
Reference in New Issue
Block a user