forked from REVOtic/SDS011
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSDS011.h
38 lines (35 loc) · 743 Bytes
/
SDS011.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// SDS011 dust sensor PM2.5 and PM10
// ---------------------------------
//
// By R. Zschiegner ([email protected])
// April 2016
//
// Documentation:
// - The iNovaFitness SDS011 datasheet
//
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#ifndef ESP32
#include <SoftwareSerial.h>
#endif
class SDS011 {
public:
SDS011(void);
void begin(HardwareSerial* serial);
void begin(HardwareSerial* serial, int8_t pin_rx, int8_t pin_tx);
#ifndef ESP32
void begin(SoftwareSerial* serial);
void begin(uint8_t pin_rx, uint8_t pin_tx);
#endif
int read(float *p25, float *p10);
void sleep();
void wakeup();
void workmode(byte mode);
private:
byte mode;
uint8_t _pin_rx, _pin_tx;
Stream *sds_data;
};