w mx
/
sensors
热释电+光强
Fork of sensors by
sensors.h@0:6dca851b4779, 2018-09-09 (annotated)
- Committer:
- Dennis_Yu
- Date:
- Sun Sep 09 13:44:05 2018 +0000
- Revision:
- 0:6dca851b4779
- Child:
- 1:1197997ae0ea
sensors librarie for high school kids
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Dennis_Yu | 0:6dca851b4779 | 1 | #ifndef SENSORS_H |
Dennis_Yu | 0:6dca851b4779 | 2 | #define SENSORS_H |
Dennis_Yu | 0:6dca851b4779 | 3 | |
Dennis_Yu | 0:6dca851b4779 | 4 | #include "mbed.h" |
Dennis_Yu | 0:6dca851b4779 | 5 | //#include <stdlib.h> |
Dennis_Yu | 0:6dca851b4779 | 6 | |
Dennis_Yu | 0:6dca851b4779 | 7 | class sr501 |
Dennis_Yu | 0:6dca851b4779 | 8 | { |
Dennis_Yu | 0:6dca851b4779 | 9 | /***** |
Dennis_Yu | 0:6dca851b4779 | 10 | * 红外热释电对象 |
Dennis_Yu | 0:6dca851b4779 | 11 | * 感应输出高电平 |
Dennis_Yu | 0:6dca851b4779 | 12 | *****/ |
Dennis_Yu | 0:6dca851b4779 | 13 | private: |
Dennis_Yu | 0:6dca851b4779 | 14 | // DigitalIn signal; |
Dennis_Yu | 0:6dca851b4779 | 15 | bool status; |
Dennis_Yu | 0:6dca851b4779 | 16 | InterruptIn signal; |
Dennis_Yu | 0:6dca851b4779 | 17 | void triggered(); |
Dennis_Yu | 0:6dca851b4779 | 18 | public: |
Dennis_Yu | 0:6dca851b4779 | 19 | sr501(PinName pSignal); |
Dennis_Yu | 0:6dca851b4779 | 20 | bool operator ==(const bool &target); |
Dennis_Yu | 0:6dca851b4779 | 21 | void reset(); |
Dennis_Yu | 0:6dca851b4779 | 22 | }; |
Dennis_Yu | 0:6dca851b4779 | 23 | |
Dennis_Yu | 0:6dca851b4779 | 24 | #endif |