This program tests Chirp - the soil moisture sensor

Dependencies:   Chirp USBDevice mbed

Fork of BME280_Hello by Toyomasa Watarai

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "USBSerial.h"
00003 #include "Chirp.h"
00004 
00005 USBSerial pc; 
00006 
00007 //I2C_SDA, I2C_SCL
00008 #define GROVE_PWR       P1_3            // control all grove power, low enable
00009 
00010 Chirp chirp(P0_5, P0_4);
00011 DigitalOut grove_pwr(GROVE_PWR);
00012 
00013 DigitalOut yellowLED(D8); 
00014 //DigitalOut yellowLEDGND(D9); 
00015 DigitalOut blueLED(D4);
00016 
00017 int main() {
00018     yellowLED = 1; 
00019    // yellowLEDGND = 1;
00020     blueLED = 1; 
00021     wait(2); 
00022     pc.printf("Running!\n");
00023     while(1) {
00024         pc.printf("%2.2f Capacitance %2.2f Temperature \r\n", chirp.getCapacitance(), chirp.getTemperature());
00025         wait(1);
00026     }
00027 }