This program tests Chirp - the soil moisture sensor

Dependencies:   Chirp USBDevice mbed

Fork of BME280_Hello by Toyomasa Watarai

Files at this revision

API Documentation at this revision

Comitter:
Vlad
Date:
Thu Jan 12 22:04:32 2017 +0000
Parent:
3:710f0b2843e4
Commit message:
Works

Changed in this revision

BME280.lib Show diff for this revision Revisions of this file
Chirp.lib Show annotated file Show diff for this revision Revisions of this file
USBDevice.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/BME280.lib	Fri Jun 26 06:42:06 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://developer.mbed.org/users/MACRUM/code/BME280/#ddcaa259e65b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Chirp.lib	Thu Jan 12 22:04:32 2017 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/Vlad/code/Chirp/#6164b94deb27
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/USBDevice.lib	Thu Jan 12 22:04:32 2017 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/mbotkinl/code/USBDevice/#0f216c4e75e5
--- a/main.cpp	Fri Jun 26 06:42:06 2015 +0000
+++ b/main.cpp	Thu Jan 12 22:04:32 2017 +0000
@@ -1,18 +1,27 @@
 #include "mbed.h"
-#include "BME280.h"
+#include "USBSerial.h"
+#include "Chirp.h"
 
-Serial pc(USBTX, USBRX);
+USBSerial pc; 
 
-#if defined(TARGET_LPC1768)
-BME280 sensor(p28, p27);
-#else
-BME280 sensor(I2C_SDA, I2C_SCL);
-#endif
+//I2C_SDA, I2C_SCL
+#define GROVE_PWR       P1_3            // control all grove power, low enable
+
+Chirp chirp(P0_5, P0_4);
+DigitalOut grove_pwr(GROVE_PWR);
+
+DigitalOut yellowLED(D8); 
+//DigitalOut yellowLEDGND(D9); 
+DigitalOut blueLED(D4);
 
 int main() {
-    
+    yellowLED = 1; 
+   // yellowLEDGND = 1;
+    blueLED = 1; 
+    wait(2); 
+    pc.printf("Running!\n");
     while(1) {
-        pc.printf("%2.2f degC, %04.2f hPa, %2.2f %%\n", sensor.getTemperature(), sensor.getPressure(), sensor.getHumidity());
+        pc.printf("%2.2f Capacitance %2.2f Temperature \r\n", chirp.getCapacitance(), chirp.getTemperature());
         wait(1);
     }
 }
--- a/mbed.bld	Fri Jun 26 06:42:06 2015 +0000
+++ b/mbed.bld	Thu Jan 12 22:04:32 2017 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/487b796308b0
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/9baf128c2fab
\ No newline at end of file