🧼 Removes extern adc
This commit is contained in:
@@ -14,4 +14,3 @@ build_flags =
|
|||||||
-D USE_WS2812=1
|
-D USE_WS2812=1
|
||||||
-D USE_USS=0
|
-D USE_USS=0
|
||||||
-D USE_SERVO=1
|
-D USE_SERVO=1
|
||||||
-D USE_ADS1115=0
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
#include <Adafruit_BMP085_U.h>
|
#include <Adafruit_BMP085_U.h>
|
||||||
#include <Adafruit_HMC5883_U.h>
|
#include <Adafruit_HMC5883_U.h>
|
||||||
#include <Adafruit_Sensor.h>
|
#include <Adafruit_Sensor.h>
|
||||||
#include <Adafruit_ADS1X15.h>
|
|
||||||
#include <NewPing.h>
|
#include <NewPing.h>
|
||||||
#include <peripherals/imu.h>
|
#include <peripherals/imu.h>
|
||||||
|
|
||||||
@@ -115,13 +114,6 @@ class Peripherals : public StatefulService<PeripheralsConfiguration> {
|
|||||||
}
|
}
|
||||||
#endif
|
#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)
|
#if FT_ENABLED(USE_USS)
|
||||||
_left_sonar = new NewPing(USS_LEFT_PIN, USS_LEFT_PIN, MAX_DISTANCE);
|
_left_sonar = new NewPing(USS_LEFT_PIN, USS_LEFT_PIN, MAX_DISTANCE);
|
||||||
_right_sonar = new NewPing(USS_RIGHT_PIN, USS_RIGHT_PIN, MAX_DISTANCE);
|
_right_sonar = new NewPing(USS_RIGHT_PIN, USS_RIGHT_PIN, MAX_DISTANCE);
|
||||||
@@ -231,16 +223,6 @@ class Peripherals : public StatefulService<PeripheralsConfiguration> {
|
|||||||
#endif
|
#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 */
|
/* IMU FUNCTIONS */
|
||||||
bool readIMU() {
|
bool readIMU() {
|
||||||
bool updated = false;
|
bool updated = false;
|
||||||
@@ -372,12 +354,6 @@ class Peripherals : public StatefulService<PeripheralsConfiguration> {
|
|||||||
Adafruit_BMP085_Unified _bmp;
|
Adafruit_BMP085_Unified _bmp;
|
||||||
bool bmp_success {false};
|
bool bmp_success {false};
|
||||||
#endif
|
#endif
|
||||||
#if FT_ENABLED(FT_ADS1015)
|
|
||||||
Adafruit_ADS1015 _ads;
|
|
||||||
#endif
|
|
||||||
#if FT_ENABLED(USE_ADS1115)
|
|
||||||
Adafruit_ADS1115 _ads;
|
|
||||||
#endif
|
|
||||||
#if FT_ENABLED(USE_USS)
|
#if FT_ENABLED(USE_USS)
|
||||||
NewPing *_left_sonar;
|
NewPing *_left_sonar;
|
||||||
NewPing *_right_sonar;
|
NewPing *_right_sonar;
|
||||||
|
|||||||
Reference in New Issue
Block a user