From c9548e2da13ca94061bd03dbc77963186b2948c0 Mon Sep 17 00:00:00 2001 From: Rune Harlyk Date: Thu, 14 Nov 2024 15:17:45 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=BC=20Removes=20extern=20adc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- esp32/features.ini | 3 +-- esp32/lib/ESP32-sveltekit/Peripherals.h | 24 ------------------------ 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/esp32/features.ini b/esp32/features.ini index 4f4f4cfd..0588d0d6 100644 --- a/esp32/features.ini +++ b/esp32/features.ini @@ -13,5 +13,4 @@ build_flags = -D USE_GPS=0 -D USE_WS2812=1 -D USE_USS=0 - -D USE_SERVO=1 - -D USE_ADS1115=0 + -D USE_SERVO=1 \ No newline at end of file diff --git a/esp32/lib/ESP32-sveltekit/Peripherals.h b/esp32/lib/ESP32-sveltekit/Peripherals.h index e7697fd9..15509665 100644 --- a/esp32/lib/ESP32-sveltekit/Peripherals.h +++ b/esp32/lib/ESP32-sveltekit/Peripherals.h @@ -19,7 +19,6 @@ #include #include #include -#include #include #include @@ -115,13 +114,6 @@ class Peripherals : public StatefulService { } #endif -#if FT_ENABLED(FT_ADS1015) || FT_ENABLED(USE_ADS1115) - if (!_ads.begin()) { - ESP_LOGE("Peripherals", "ADS1015/ADS1115 not found"); - } - _ads.startADCReading(ADS1X15_REG_CONFIG_MUX_DIFF_0_1, /*continuous=*/false); -#endif - #if FT_ENABLED(USE_USS) _left_sonar = new NewPing(USS_LEFT_PIN, USS_LEFT_PIN, MAX_DISTANCE); _right_sonar = new NewPing(USS_RIGHT_PIN, USS_RIGHT_PIN, MAX_DISTANCE); @@ -231,16 +223,6 @@ class Peripherals : public StatefulService { #endif } - /* ADC FUNCTIONS*/ - int16_t readADCVoltage(uint8_t channel) { - int16_t voltage = -1; -#if FT_ENABLED(FT_ADS1015) || FT_ENABLED(USE_ADS1115) - float adc0 = _ads.readADC_SingleEnded(channel); - voltage = _ads.computeVolts(adc0); -#endif - return voltage; - } - /* IMU FUNCTIONS */ bool readIMU() { bool updated = false; @@ -372,12 +354,6 @@ class Peripherals : public StatefulService { Adafruit_BMP085_Unified _bmp; bool bmp_success {false}; #endif -#if FT_ENABLED(FT_ADS1015) - Adafruit_ADS1015 _ads; -#endif -#if FT_ENABLED(USE_ADS1115) - Adafruit_ADS1115 _ads; -#endif #if FT_ENABLED(USE_USS) NewPing *_left_sonar; NewPing *_right_sonar;