mirror of https://github.com/sqfmi/Watchy.git
fixed bugs and change temp. sensor
parent
6363caeac2
commit
7a28210b41
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "Watchy",
|
||||
"version": "1.2.9",
|
||||
"version": "1.2.10",
|
||||
"description": "Watchy - An Open Source E-Paper Watch by SQFMI",
|
||||
"authors": [
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name=Watchy
|
||||
version=1.2.9
|
||||
version=1.2.10
|
||||
author=SQFMI
|
||||
maintainer=SQFMI
|
||||
sentence=Watchy - An Open Source E-Paper Watch by SQFMI
|
||||
|
|
|
@ -565,8 +565,8 @@ weatherData Watchy::getWeatherData(){
|
|||
//turn off radios
|
||||
WiFi.mode(WIFI_OFF);
|
||||
btStop();
|
||||
}else{//No WiFi, use RTC Temperature
|
||||
uint8_t temperature = RTC.temperature() / 4; //celsius
|
||||
}else{//No WiFi, use internal temperature sensor
|
||||
uint8_t temperature = sensor.readTemperature(); //celsius
|
||||
if(strcmp(TEMP_UNIT, "imperial") == 0){
|
||||
temperature = temperature * 9. / 5. + 32.; //fahrenheit
|
||||
}
|
||||
|
|
|
@ -62,7 +62,11 @@ void WatchyRTC::set(tmElements_t tm){
|
|||
rtc_ds.set(t);
|
||||
}else{
|
||||
rtc_pcf.setDate(tm.Day, _getDayOfWeek(tm.Day, tm.Month, tm.Year+YEAR_OFFSET_PCF), tm.Month, 0, tm.Year);
|
||||
rtc_pcf.setTime(tm.Hour, tm.Minute, tm.Second);
|
||||
rtc_pcf.setTime(tm.Hour, tm.Minute, tm.Second);
|
||||
rtc_pcf.clearAlarm();
|
||||
int nextAlarmMinute = rtc_pcf.getMinute();
|
||||
nextAlarmMinute = (nextAlarmMinute == 59) ? 0 : (nextAlarmMinute + 1);
|
||||
rtc_pcf.setAlarm(nextAlarmMinute, 99, 99, 99);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -70,12 +74,12 @@ uint8_t WatchyRTC::temperature(){
|
|||
if(rtcType == DS3231){
|
||||
return rtc_ds.temperature();
|
||||
}else{
|
||||
return 25;
|
||||
return 255; //error
|
||||
}
|
||||
}
|
||||
|
||||
void WatchyRTC::_DSConfig(String datetime){
|
||||
if(datetime != NULL){
|
||||
if(datetime != ""){
|
||||
tmElements_t tm;
|
||||
tm.Year = _getValue(datetime, ':', 0).toInt() - YEAR_OFFSET_DS;//offset from 1970, since year is stored in uint8_t
|
||||
tm.Month = _getValue(datetime, ':', 1).toInt();
|
||||
|
@ -93,7 +97,8 @@ void WatchyRTC::_DSConfig(String datetime){
|
|||
}
|
||||
|
||||
void WatchyRTC::_PCFConfig(String datetime){
|
||||
if(datetime != NULL){
|
||||
rtc_pcf.initClock();
|
||||
if(datetime != ""){
|
||||
tmElements_t tm;
|
||||
tm.Year = _getValue(datetime, ':', 0).toInt();
|
||||
tm.Month = _getValue(datetime, ':', 1).toInt();
|
||||
|
@ -102,12 +107,10 @@ void WatchyRTC::_PCFConfig(String datetime){
|
|||
tm.Minute = _getValue(datetime, ':', 4).toInt();
|
||||
tm.Second = _getValue(datetime, ':', 5).toInt();
|
||||
|
||||
rtc_pcf.initClock();
|
||||
//day, weekday, month, century(1=1900, 0=2000), year(0-99)
|
||||
rtc_pcf.setDate(tm.Day, _getDayOfWeek(tm.Day, tm.Month, tm.Year), tm.Month, 0, tm.Year - YEAR_OFFSET_PCF);//offset from 2000, since year is stored in uint8_t
|
||||
//hr, min, sec
|
||||
rtc_pcf.setTime(tm.Hour, tm.Minute, tm.Second);
|
||||
|
||||
}
|
||||
rtc_pcf.clearAlarm();
|
||||
int nextAlarmMinute = rtc_pcf.getMinute();
|
||||
|
|
Loading…
Reference in New Issue