File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
pio_workspace/lib/power_custom Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ void ADCSensors::refreshCurrent() {
83
83
}
84
84
85
85
float ADCSensors::convertVoltage (float adcVoltage) {
86
- return (adcVoltage - 0.08 ) * (16.8 - 12.8 ) / (1.27 - 0.08 ) + 12.8 ;
86
+ return (adcVoltage * 2 ) * (16.8 - 12.8 ) / (2.586 - 0.180 ) + 12.5 ;
87
87
}
88
88
89
89
float ADCSensors::convertCurrent (float adcCurrent) {
Original file line number Diff line number Diff line change 5
5
#include " Wire.h"
6
6
#include " Adafruit_ADS1X15.h"
7
7
8
- #define ADC_VOLTAGE_ADDR 0x4B
9
8
#define ADC_CURRENT1_ADDR 0x48
10
9
#define ADC_CURRENT2_ADDR 0x49
10
+ #define ADC_VOLTAGE_ADDR 0x4B
11
11
12
12
class ADCSensors {
13
13
public:
@@ -21,9 +21,9 @@ class ADCSensors {
21
21
bool voltageEnabled;
22
22
bool currentEnabled;
23
23
24
- Adafruit_ADS1115 adcVoltage;
25
24
Adafruit_ADS1115 adcCurrent1;
26
25
Adafruit_ADS1115 adcCurrent2;
26
+ Adafruit_ADS1115 adcVoltage;
27
27
28
28
int16_t rawADCVoltage[2 ];
29
29
float computedADCVoltage[2 ];
You can’t perform that action at this time.
0 commit comments