yasuyuki onodera / AM2320

Dependents:   mbed_AM2320 Fungi Fungi Nucleo_SSD1306_DS1302_ESP8266_AM2320_BME280 ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers AM2320.h Source File

AM2320.h

00001 //**********************
00002 // AM2320.h for mbed
00003 //
00004 // (C)Copyright 2015 All rights reserved by Y.Onodera
00005 // http://einstlab.web.fc2.com
00006 //**********************
00007 #ifndef AM2320_H_
00008 #define AM2320_H_
00009 
00010 #define AM2320_ADDR    0xB8
00011 #define AM2320_HUM_H  0x00
00012 #define AM2320_HUM_L  0x01
00013 #define AM2320_TEMP_H  0x02
00014 #define AM2320_TEMP_L  0x03
00015 
00016 #include "mbed.h"
00017 #include "typedef.h"
00018 
00019 class AM2320{
00020 public:
00021     AM2320 (PinName sda, PinName scl);
00022     AM2320 (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 /* AM2320_H_ */
00039 
00040 
00041