hadif azli
/
TEST123
BLYNK TEST
AM2321.h@2:6cd3b0947188, 2016-06-15 (annotated)
- Committer:
- lixianyu
- Date:
- Wed Jun 15 03:08:40 2016 +0000
- Revision:
- 2:6cd3b0947188
- Parent:
- 0:d8f4c441e032
- Child:
- 3:4cd9171ba989
PM2.5????????5V??????????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lixianyu | 0:d8f4c441e032 | 1 | // |
lixianyu | 0:d8f4c441e032 | 2 | // AM2321 Temperature & Humidity Sensor library for Arduino |
lixianyu | 0:d8f4c441e032 | 3 | // VERSION: 0.1.0 |
lixianyu | 0:d8f4c441e032 | 4 | // |
lixianyu | 0:d8f4c441e032 | 5 | // The MIT License (MIT) |
lixianyu | 0:d8f4c441e032 | 6 | // |
lixianyu | 0:d8f4c441e032 | 7 | // Copyright (c) 2013 Wang Dong |
lixianyu | 0:d8f4c441e032 | 8 | // |
lixianyu | 0:d8f4c441e032 | 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy |
lixianyu | 0:d8f4c441e032 | 10 | // of this software and associated documentation files (the "Software"), to deal |
lixianyu | 0:d8f4c441e032 | 11 | // in the Software without restriction, including without limitation the rights |
lixianyu | 0:d8f4c441e032 | 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
lixianyu | 0:d8f4c441e032 | 13 | // copies of the Software, and to permit persons to whom the Software is |
lixianyu | 0:d8f4c441e032 | 14 | // furnished to do so, subject to the following conditions: |
lixianyu | 0:d8f4c441e032 | 15 | // |
lixianyu | 0:d8f4c441e032 | 16 | // The above copyright notice and this permission notice shall be included in |
lixianyu | 0:d8f4c441e032 | 17 | // all copies or substantial portions of the Software. |
lixianyu | 0:d8f4c441e032 | 18 | // |
lixianyu | 0:d8f4c441e032 | 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
lixianyu | 0:d8f4c441e032 | 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
lixianyu | 0:d8f4c441e032 | 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
lixianyu | 0:d8f4c441e032 | 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
lixianyu | 0:d8f4c441e032 | 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
lixianyu | 0:d8f4c441e032 | 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
lixianyu | 0:d8f4c441e032 | 25 | // THE SOFTWARE. |
lixianyu | 0:d8f4c441e032 | 26 | // |
lixianyu | 0:d8f4c441e032 | 27 | |
lixianyu | 0:d8f4c441e032 | 28 | #ifndef __ARDUINO_AM2321_H__ |
lixianyu | 0:d8f4c441e032 | 29 | #define __ARDUINO_AM2321_H__ |
lixianyu | 2:6cd3b0947188 | 30 | |
lixianyu | 2:6cd3b0947188 | 31 | //#include "mbed.h" |
lixianyu | 0:d8f4c441e032 | 32 | //#include <Arduino.h> |
lixianyu | 0:d8f4c441e032 | 33 | |
lixianyu | 0:d8f4c441e032 | 34 | #define LIBAM2321_VERSION "0.1.0" |
lixianyu | 0:d8f4c441e032 | 35 | |
lixianyu | 0:d8f4c441e032 | 36 | |
lixianyu | 0:d8f4c441e032 | 37 | class AM2321 |
lixianyu | 0:d8f4c441e032 | 38 | { |
lixianyu | 0:d8f4c441e032 | 39 | public: |
lixianyu | 0:d8f4c441e032 | 40 | int temperature; |
lixianyu | 0:d8f4c441e032 | 41 | unsigned int humidity; |
lixianyu | 0:d8f4c441e032 | 42 | public: |
lixianyu | 0:d8f4c441e032 | 43 | bool read(); |
lixianyu | 0:d8f4c441e032 | 44 | bool available(); |
lixianyu | 0:d8f4c441e032 | 45 | public: |
lixianyu | 2:6cd3b0947188 | 46 | unsigned long uid(); |
lixianyu | 0:d8f4c441e032 | 47 | |
lixianyu | 0:d8f4c441e032 | 48 | public: |
lixianyu | 0:d8f4c441e032 | 49 | AM2321(); |
lixianyu | 0:d8f4c441e032 | 50 | }; |
lixianyu | 0:d8f4c441e032 | 51 | |
lixianyu | 0:d8f4c441e032 | 52 | #endif |
lixianyu | 2:6cd3b0947188 | 53 | |
lixianyu | 0:d8f4c441e032 | 54 | // |
lixianyu | 0:d8f4c441e032 | 55 | // END OF FILE |
lixianyu | 0:d8f4c441e032 | 56 | // |