diff --git a/library.json b/library.json index 0ad88ae..712e693 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Watchy", - "version": "1.2.8", + "version": "1.2.9", "description": "Watchy - An Open Source E-Paper Watch by SQFMI", "authors": [ { diff --git a/library.properties b/library.properties index f79eccb..c805d75 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Watchy -version=1.2.8 +version=1.2.9 author=SQFMI maintainer=SQFMI sentence=Watchy - An Open Source E-Paper Watch by SQFMI diff --git a/src/Watchy.cpp b/src/Watchy.cpp index 9fcf837..1a1ee9a 100644 --- a/src/Watchy.cpp +++ b/src/Watchy.cpp @@ -581,8 +581,11 @@ weatherData Watchy::getWeatherData(){ } float Watchy::getBatteryVoltage(){ - // Battery voltage goes through a 1/2 divider. - return analogReadMilliVolts(ADC_PIN) / 1000.0f * 2.0f; + if(RTC.rtcType == DS3231){ + return analogReadMilliVolts(V10_ADC_PIN) / 1000.0f * 2.0f; // Battery voltage goes through a 1/2 divider. + }else{ + return analogReadMilliVolts(V15_ADC_PIN) / 1000.0f * 2.0f; + } } uint16_t Watchy::_readRegister(uint8_t address, uint8_t reg, uint8_t *data, uint16_t len) diff --git a/src/config.h b/src/config.h index 716a57c..36815fb 100644 --- a/src/config.h +++ b/src/config.h @@ -4,8 +4,8 @@ //pins #define SDA 21 #define SCL 22 -//#define ADC_PIN 33 -#define ADC_PIN 35 +#define V10_ADC_PIN 33 //OG v1.0 Watchy +#define V15_ADC_PIN 35 //v1.5 Watchy with PCF8563 RTC #define RTC_PIN GPIO_NUM_27 #define CS 5 #define DC 10