[m] Minor improvements
This commit is contained in:
parent
58ba94a455
commit
9f9bb7856d
10
metesp.ino
10
metesp.ino
@ -45,7 +45,7 @@ static OWM* owm[6] = {new OWM(LOCATION_0, OPENWEATHER_API),
|
||||
new OWM(LOCATION_1, OPENWEATHER_API),
|
||||
new OWM(LOCATION_2, OPENWEATHER_API),
|
||||
NULL,NULL,NULL};
|
||||
static Influx* iflx = new Influx(NULL, owm);//TODO: Add sensor
|
||||
static Influx* iflx = new Influx(sensor, owm);//TODO: Add sensor
|
||||
static TimedFun* tf = new TimedFun();
|
||||
|
||||
static bool time_update = true, view_update = true, view_refresh = false;
|
||||
@ -121,10 +121,10 @@ REGISTER_TIMEDFUN(NTP_TF, ntp->updateNTPtime());
|
||||
|
||||
void setup_TIMEDFUN() {
|
||||
REGISTER_TIMEDFUN_CALL(NTP_TF, 60*60);
|
||||
REGISTER_TIMEDFUN_CALL(SENSOR_MEASURE_TF,5);
|
||||
REGISTER_TIMEDFUN_CALL(OWM_MEASURE_TF,5*60);
|
||||
// REGISTER_TIMEDFUN_CALL(RECORD_LOCAL_TF,1*60);
|
||||
// REGISTER_TIMEDFUN_CALL(RECORD_WEATHER_TF,5*60);
|
||||
REGISTER_TIMEDFUN_CALL(SENSOR_MEASURE_TF,5); // 5s LOCAL SYNC
|
||||
REGISTER_TIMEDFUN_CALL(OWM_MEASURE_TF,5*60); // 5m WEATHER SYNC
|
||||
REGISTER_TIMEDFUN_CALL(RECORD_LOCAL_TF,1*60); // 1m LOCAL DB
|
||||
// REGISTER_TIMEDFUN_CALL(RECORD_WEATHER_TF,5*60); // 5m WEATHER DB
|
||||
}
|
||||
|
||||
void setup_POWER() {
|
||||
|
@ -153,8 +153,8 @@ void LightDisplay::drawDisplay() {
|
||||
|
||||
Paint_DrawFltUnit(76,0,sensor->light_lux, "lux", &Font24, BLACK, WHITE);
|
||||
Paint_DrawIntUnit(76,24*1,sensor->uvi, "uvi", &Font24, BLACK, WHITE);
|
||||
Paint_DrawFltUnit(76,24*2,sensor->light, "l", &Font24, BLACK, WHITE);
|
||||
Paint_DrawIntUnit(76,24*3,sensor->light_vis, "vl", &Font24, BLACK, WHITE);
|
||||
Paint_DrawIntUnit(76,24*2,sensor->light_full, "f", &Font24, BLACK, WHITE);
|
||||
Paint_DrawIntUnit(76,24*3,sensor->light_vis, "v", &Font24, BLACK, WHITE);
|
||||
|
||||
Paint_DrawString_EN(2,EPD_2IN13_V2_WIDTH - Font16.Height,"Nominal", &Font16, WHITE, BLACK);
|
||||
}
|
||||
|
@ -87,12 +87,11 @@ public:
|
||||
dp.addTag("device", "WESP0");
|
||||
dp.addTag("location", "local");
|
||||
|
||||
dp.addField("temperature", sensor->temp);
|
||||
dp.addField("pressure", sensor->pres);
|
||||
dp.addField("humidity", sensor->temp);
|
||||
dp.addField("heat_index", sensor->heatidx);
|
||||
dp.addField("temperature", float(sensor->temp));
|
||||
dp.addField("pressure", int32_t(sensor->pres));
|
||||
dp.addField("humidity", int32_t(sensor->hum));
|
||||
dp.addField("temperature_feel", float(sensor->heatidx));
|
||||
|
||||
dp.addField("light", sensor->light);
|
||||
dp.addField("uv", sensor->uv);
|
||||
dp.addField("uvi", sensor->uvi);
|
||||
|
||||
|
@ -77,7 +77,7 @@ bool TSL25911::ReadData(uint32_t* dataf) {
|
||||
uint8_t* data = static_cast<uint8_t*>(static_cast<void*>(dataf));
|
||||
bool success = WriteRegister(REG_ENABLE, ENABLE_POWERON | ENABLE_AEN);
|
||||
|
||||
delay((uint32_t)atime());
|
||||
delay((uint32_t)atime()+100);
|
||||
|
||||
success &= ReadRegister(CHAN0_LOW,&data[0],2);
|
||||
success &= ReadRegister(CHAN1_LOW,&data[2],2);
|
||||
|
@ -24,7 +24,6 @@ public:
|
||||
float hum = 0;
|
||||
float heatidx = 0;
|
||||
|
||||
float light = 0;
|
||||
uint32_t uv = 0;
|
||||
uint32_t uvi = 0;
|
||||
|
||||
|
@ -43,7 +43,6 @@ public:
|
||||
e.first();
|
||||
}
|
||||
}
|
||||
old_counter = counter;
|
||||
};
|
||||
|
||||
void updateForce() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user