Skip to content

Commit

Permalink
🧼 Removes extern adc
Browse files Browse the repository at this point in the history
  • Loading branch information
runeharlyk committed Nov 14, 2024
1 parent 841ae91 commit c9548e2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
3 changes: 1 addition & 2 deletions esp32/features.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
24 changes: 0 additions & 24 deletions esp32/lib/ESP32-sveltekit/Peripherals.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <Adafruit_BMP085_U.h>
#include <Adafruit_HMC5883_U.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_ADS1X15.h>
#include <NewPing.h>
#include <peripherals/imu.h>

Expand Down Expand Up @@ -115,13 +114,6 @@ class Peripherals : public StatefulService<PeripheralsConfiguration> {
}
#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);
Expand Down Expand Up @@ -231,16 +223,6 @@ class Peripherals : public StatefulService<PeripheralsConfiguration> {
#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;
Expand Down Expand Up @@ -372,12 +354,6 @@ class Peripherals : public StatefulService<PeripheralsConfiguration> {
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;
Expand Down

0 comments on commit c9548e2

Please sign in to comment.