Update sds011read.cpp

This commit is contained in:
August Quint 2020-02-19 13:57:21 +01:00 committed by GitHub
parent a51deb4116
commit 40c27f8c66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,12 +21,11 @@ boolean isSDS011Active;
bool sds011_init() bool sds011_init()
{ {
pm25 = pm10 = 0.0; pm25 = pm10 = 0.0;
sdsSerial.begin(9600, SERIAL_8N1, ESP_PIN_RX, ESP_PIN_TX); sdsSensor.begin (&sdsSerial, ESP_PIN_RX, ESP_PIN_TX);
sdsSensor.begin (&sdsSerial); sds011_sleep(); // we do sleep/wakup by ourselves
sdsSensor.contmode(0); // for safety: no wakeup/sleep by the sensor return true;
sds011_sleep(); // we do it by ourselves
return true;
} }
// reading data: // reading data:
void sds011_loop() void sds011_loop()
{ {