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/
Diff: Chirp.h
- Revision:
- 0:6164b94deb27
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Chirp.h Thu Jan 12 22:01:43 2017 +0000
@@ -0,0 +1,28 @@
+
+#ifndef MBED_CHIRP_H
+#define MBED_CHIRP_H
+
+#include "mbed.h"
+
+//#define _DEBUG
+#define DEFAULT_SLAVE_ADDRESS (0x20 << 1)
+
+
+class Chirp
+{
+ public:
+ Chirp(PinName sda, PinName sck, char slave_adr = DEFAULT_SLAVE_ADDRESS);
+ float getCapacitance(void);
+ float getTemperature(void);
+
+ private:
+
+ I2C *i2c_p;
+ I2C &i2c;
+ char address;
+};
+
+
+
+
+#endif // MBED_CHIRP_H
\ No newline at end of file