This program tests Chirp - the soil moisture sensor
Dependencies: Chirp USBDevice mbed
Fork of BME280_Hello by
Diff: main.cpp
- Revision:
- 4:a1a7af709ddc
- Parent:
- 0:2c9585cecfde
--- 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);
}
}
