Skip to content

Commit

Permalink
carga datos base
Browse files Browse the repository at this point in the history
  • Loading branch information
richonguzman committed Jun 26, 2024
1 parent e5e2c6a commit 86cf12d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
4 changes: 3 additions & 1 deletion data/igate_conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@
"sendExternalVoltage": false,
"externalVoltagePin": 34,
"monitorExternalVoltage": false,
"externalSleepVoltage": 10.9
"externalSleepVoltage": 10.9,
"voltageDividerR1": 100.0,
"voltageDividerR2": 27.0
},
"bme": {
"active": false,
Expand Down
8 changes: 7 additions & 1 deletion data_embed/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,13 @@ <h5>
</svg>
Battery
</h5>
<small>Battery Monitor & Health</small>
<small>Battery Monitor & Health
<br>
<br>
Max Voltage on input pin is 3.3V.
<br>
Calculate voltage divider accordingly.
</small>
</div>
<div class="col-9 mt-2">
<div class="row mt-2">
Expand Down
6 changes: 6 additions & 0 deletions src/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ void Configuration::writeFile() {
data["battery"]["externalVoltagePin"] = battery.externalVoltagePin;
data["battery"]["monitorExternalVoltage"] = battery.monitorExternalVoltage;
data["battery"]["externalSleepVoltage"] = battery.externalSleepVoltage;
data["battery"]["voltageDividerR1"] = battery.voltageDividerR1;
data["battery"]["voltageDividerR2"] = battery.voltageDividerR2;

data["bme"]["active"] = bme.active;
data["bme"]["heightCorrection"] = bme.heightCorrection;
Expand Down Expand Up @@ -144,6 +146,8 @@ bool Configuration::readFile() {
battery.externalVoltagePin = data["battery"]["externalVoltagePin"].as<int>();
battery.monitorExternalVoltage = data["battery"]["monitorExternalVoltage"].as<bool>();
battery.externalSleepVoltage = data["battery"]["externalSleepVoltage"].as<float>();
battery.voltageDividerR1 = data["battery"]["voltageDividerR1"].as<float>();
battery.voltageDividerR2 = data["battery"]["voltageDividerR2"].as<float>();

aprs_is.passcode = data["aprs_is"]["passcode"].as<String>();
aprs_is.server = data["aprs_is"]["server"].as<String>();
Expand Down Expand Up @@ -345,6 +349,8 @@ void Configuration::init() {
battery.externalVoltagePin = 34;
battery.monitorExternalVoltage = false;
battery.externalSleepVoltage = 3.0;
battery.voltageDividerR1 = 100.0;
battery.voltageDividerR2 = 27.0;

lowPowerMode = false;
lowVoltageCutOff = 0;
Expand Down
2 changes: 2 additions & 0 deletions src/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ class BATTERY {
int externalVoltagePin;
bool monitorExternalVoltage;
float externalSleepVoltage;
float voltageDividerR1;
float voltageDividerR2;
};

class BME {
Expand Down

0 comments on commit 86cf12d

Please sign in to comment.