AM2321 library
Dependents: mbed_AM2321_copy mbed_AM2321
See http://developer.mbed.org/users/yasuyuki/notebook/AM2321/
Diff: AM2321.h
- Revision:
- 0:3656aea4e6f6
- Child:
- 1:39f20504d5c5
diff -r 000000000000 -r 3656aea4e6f6 AM2321.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/AM2321.h Wed Oct 08 02:48:36 2014 +0000 @@ -0,0 +1,40 @@ +//********************** +// AM2321.h for mbed +// +// (C)Copyright 2014 All rights reserved by Y.Onodera +// http://einstlab.web.fc2.com +//********************** +#ifndef AM2321_H_ +#define AM2321_H_ + +#define AM2321_ADDR 0xB8 +#define AM2321_HUM_H 0x00 +#define AM2321_HUM_L 0x01 +#define AM2321_TEMP_H 0x02 +#define AM2321_TEMP_L 0x03 + +#include "mbed.h" +#include "typedef.h" + +class AM2321{ +public: + AM2321 (PinName sda, PinName scl); + AM2321 (I2C& p_i2c); + + void get(); + int humidity(); + int temperature(); + +protected: + + I2C _i2c; + + WORD_VAL hum; + WORD_VAL temp; + char buf[8]; + +}; + +#endif /* AM2321_H_ */ + +