This commit is contained in:
richonguzman 2023-07-06 00:14:26 -04:00
parent 23302ab75a
commit d40057ebbd
5 changed files with 41 additions and 2 deletions

View File

@ -74,7 +74,7 @@ g) BME section:
__________________________________________
LoRa APRS iGATE/Digirepeater working on this boards:
- LILYGO ESP32 LoRa32 v2-1-1.6
- LILYGO ESP32 LoRa32 v2-1-1.6 and T3
- ESP32 Wroom + SX1278 LoRa Module for a DIY Version.
- HELTEC_WIFI_LORA_32_V2 (check "pins_config.h" and "display.cpp" for aditional configuration).
__________________________________________
@ -91,7 +91,7 @@ Versions:
- 2023.06.12 Syslog added.
- 2023.06.17 Support for BME280 Module (Temperature, Humidity, Pressure) added.
- 2023.06.18 Info on Oled Screen mayor update, added RSSI and Distance to Listened Station.
- 2023.06.19 Failsafe mods to configuration to ensure correct OTA updates.
- 2023.07.05 Adding monitor info of Battery connected
__________________________________________
Special Thanks to the help in testing and developing to Manfred (DC2MH) , for showing me the "way of good coding" to Tihomir (CA3TSK) and much more Ham Licence Ops all over the world.

View File

@ -32,6 +32,8 @@ uint32_t lastBeaconTx = 0;
uint32_t previousWiFiMillis = 0;
uint32_t lastScreenOn = millis();
String batteryVoltage;
std::vector<String> lastHeardStation;
std::vector<String> lastHeardStation_temp;
@ -39,6 +41,7 @@ String firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seven
void setup() {
Serial.begin(115200);
pinMode(batteryPin, INPUT);
pinMode(greenLed, OUTPUT);
delay(1000);
Utils::setupDisplay();

22
src/battery_utils.cpp Normal file
View File

@ -0,0 +1,22 @@
#include "battery_utils.h"
#include "pins_config.h"
extern String batteryVoltage;
float adcReadingTransformation = (4095/3.3);
namespace BATTERY_Utils {
String checkVoltages() {
float sample;
int sampleSum = 0;
for (int i=0; i<100; i++) {
sample = analogRead(batteryPin);
sampleSum += sample;
delayMicroseconds(50);
}
batteryVoltage = 2.1571 *(sampleSum/100) * adcReadingTransformation;
return String(batteryVoltage);
}
}

12
src/battery_utils.h Normal file
View File

@ -0,0 +1,12 @@
#ifndef BATTERY_UTILS_H_
#define BATTERY_UTILS_H_
#include <Arduino.h>
namespace BATTERY_Utils {
String checkVoltages();
}
#endif

View File

@ -15,6 +15,8 @@
#define greenLed 25 // Green Led
#define batteryPin 35
/* (Same pins for LILYGO LoRa32 and ESP32 Wroom Dev )
SX1278-------------------> ESP32 ttgo-lora32-v21 and ESP32 WROOM Dev
GND GND