Skip to content

Commit

Permalink
fixed possible wrong sample rate delay location on notification
Browse files Browse the repository at this point in the history
  • Loading branch information
hpsaturn committed Jul 22, 2018
1 parent cd29a06 commit a347ca7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ void sensorRead(){
String display = String(count)+" P25: " + String(pm2_5) + " | P10: " + String(pm10);
if(deviceConnected)displayOnBuffer(display);
count++;
delay(SAMPLING_RATE);
}
else{
Serial.println("Warnning: hpma115S0 cant not read!");
}
}

Expand Down Expand Up @@ -161,7 +163,7 @@ void bleLoop(){
sensorRead();
pCharactPM25->setValue(sensorGetRead25().c_str());
pCharactPM25->notify();
delay(200); // bluetooth stack will go into congestion, if too many packets are sent
delay(SAMPLING_RATE); // bluetooth stack will go into congestion, if too many packets are sent
}
// disconnecting
if (!deviceConnected && oldDeviceConnected) {
Expand Down

0 comments on commit a347ca7

Please sign in to comment.