Merge pull request #31 from ohmytime/main

Adjust bat ADC's for portable
This commit is contained in:
Sjef Verhoeven PE5PVB
2023-06-18 14:51:32 +02:00
committed by GitHub
2 changed files with 10 additions and 5 deletions

View File

@@ -135,7 +135,7 @@ unsigned int MWHighEdgeSet;
unsigned int MWLowEdgeSet;
unsigned int SWHighEdgeSet;
unsigned int SWLowEdgeSet;
byte showSWMIBand = 1; // Fix Me: Menu options: 0: don't show 1: show up
byte showSWMIBand = 1;
uint16_t SWMIBandPos;
uint16_t SWMIBandPosold; // Fix Me: Should store this parameter into flash, for use of restart.
String SWMIBandstring = String();
@@ -3450,7 +3450,7 @@ void ShowRSSI() {
}
void ShowBattery() {
battery = map(constrain(analogRead(BATTERY_PIN), 1965, 2300), 1965, 2300, 0, 4);
battery = map(constrain(analogRead(BATTERY_PIN), BAT_LEVEL_EMPTY, BAT_LEVEL_FULL), BAT_LEVEL_EMPTY, BAT_LEVEL_FULL, 0, BAT_LEVEL_STAGE);
if (batteryold != battery) {
tft.drawRect(300, 8, 12, 20, TFT_WHITE);
tft.fillRect(303, 4, 6, 4, TFT_WHITE);

View File

@@ -19,9 +19,14 @@ enum RADIO_TUNE_MODE {
TUNE_MAN, TUNE_AUTO, TUNE_MEM, TUNE_MI_BAND
};
#define FREQ_MW_STEP_9K 9
#define FREQ_MW_STEP_10K 10
#define FREQ_SW_STEP_5K 5
#define BAT_LEVEL_EMPTY 1600
#define BAT_LEVEL_WARN 1700
#define BAT_LEVEL_FULL 2270
#define BAT_LEVEL_STAGE 4
#define FREQ_MW_STEP_9K 9
#define FREQ_MW_STEP_10K 10
#define FREQ_SW_STEP_5K 5
#define FREQ_LW_LOW_EDGE_MIN 100
#define FREQ_LW_HIGH_EDGE_MAX 519