Chirp is a great little soil moisture sensor. This is a library for the Chirp soil moisture sensor. It supports reading Capacitance (soil moisture) and soil temperature. You can get Chirp on Tindie https://www.tindie.com/products/miceuz/i2c-soil-moisture-sensor/ And read documentation on github https://www.tindie.com/products/miceuz/i2c-soil-moisture-sensor/

Dependents:   Test_Chirp

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Chirp.h Source File

Chirp.h

00001 
00002 #ifndef MBED_CHIRP_H
00003 #define MBED_CHIRP_H
00004 
00005 #include "mbed.h"
00006 
00007 //#define _DEBUG
00008 #define DEFAULT_SLAVE_ADDRESS (0x20 << 1)
00009 
00010 
00011 class Chirp
00012 {
00013     public:
00014         Chirp(PinName sda, PinName sck, char slave_adr = DEFAULT_SLAVE_ADDRESS);
00015         float getCapacitance(void);
00016         float getTemperature(void);
00017     
00018     private:
00019         
00020         I2C         *i2c_p;
00021         I2C         &i2c;
00022         char        address;
00023 };
00024 
00025 
00026 
00027 
00028 #endif // MBED_CHIRP_H