EasyManua.ls Logo

sparkfun ESP32 - Page 16

sparkfun ESP32
20 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
//Calculateanddisplayrainfalltotals.
Serial.print("Rainfalllasthour:");
Serial.println(float(rainLastHour)*0.011,3);
Serial.print("Rainfalllastday:");
Serial.println(float(rainLastDay)*0.011,3);
Serial.print("Rainfalltodate:");
Serial.println(float(rainTicks)*0.011,3);
//TriggertheCCS811'sinternalupdateprocedure,then
//dumpthevaluestotheserialport.
ccs.readAlgorithmResults();
Serial.print("CO2:");
Serial.println(ccs.getCO2());
Serial.print("tVOC:");
Serial.println(ccs.getTVOC());
Serial.print("Luminousflux:");
Serial.println(apds.readLuxLevel(),6);
//Calculatetheamountofraininthelastdayandhour.
r
ainLastHour=0;
rainLastDay=0;
//Ifthereareanycapturedrainsensorticks...
if (rainTicks>0)
{
//Startattheendofthelist.rainTickIndexwillalwa
ysbeonegreater
//thanthenumberofcapturedsamples.
int i= rainTickIndex1;
//Iterateoverthelistandcountupthenumberofsamp
lest
hathavebeen
//
capturedwithtimestampsinthelasthour.
while ((rainTickList[i]>= secsClock S_IN_HR)&& rainT
ickList[i]!= 0)
{
i;
if (i<0)i= NO_RAIN_SAMPLES1;
rainLastHour++;
}
//Repeattheprocess,thistimeoverdays.
i= rainTickIndex1;
while ((rainTickList[i]>= secsClock S_IN_DAY)&& rain
TickList[i]!= 0)
{
i;
if
(i<0
)i= NO_RAIN_SAMPLES1;
rainLastDay++;
}
rainLastDayStart=i;
}
}
//Updatewundergroundonceeverysixtyseconds.
if (millis() wundergroundUpdateTimer>= 60000)
{
wundergroundUpdateTimer= millis();
//SetupthegenericuseeverytimepartoftheURL
String url= "/weatherstation/updateweatherstation.php";
url+= "?ID=";
url+= ID;
Page 1
6
of 20

Related product manuals