AM2321 library

Dependents:   mbed_AM2321_copy mbed_AM2321

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers AM2321.h Source File

AM2321.h

00001 //**********************
00002 // AM2321.h for mbed
00003 //
00004 // (C)Copyright 2014 All rights reserved by Y.Onodera
00005 // http://einstlab.web.fc2.com
00006 //**********************
00007 #ifndef AM2321_H_
00008 #define AM2321_H_
00009 
00010 #define AM2321_ADDR    0xB8
00011 #define AM2321_HUM_H  0x00
00012 #define AM2321_HUM_L  0x01
00013 #define AM2321_TEMP_H  0x02
00014 #define AM2321_TEMP_L  0x03
00015 
00016 #include "mbed.h"
00017 #include "typedef.h"
00018 
00019 class AM2321{
00020 public:
00021     AM2321 (PinName sda, PinName scl);
00022     AM2321 (I2C& p_i2c);
00023 
00024     void get();
00025     unsigned short humidity();
00026     signed short temperature();
00027 
00028 protected:
00029     
00030     I2C _i2c;
00031 
00032     WORD_VAL hum;
00033     WORD_VAL temp;
00034     char buf[8];
00035 
00036 };
00037 
00038 #endif /* AM2321_H_ */
00039 
00040 
00041