Moisture: Add C Src and Example

Changed from GroveMoisture.

Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
This commit is contained in:
Abhishek Malik
2016-09-12 15:25:45 -07:00
committed by Noel Eck
parent 0f7bb5573c
commit 1caf805d2b
19 changed files with 112 additions and 85 deletions

View File

@ -142,7 +142,7 @@ add_example (adc121c021)
add_example (ds1307)
add_example (a110x)
add_example (gp2y0a)
add_example (grovemoisture)
add_example (moisture)
add_example (groveehr)
add_example (ta12200)
add_example (grovelinefinder)

View File

@ -25,7 +25,7 @@
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include "grovemoisture.hpp"
#include "moisture.hpp"
using namespace std;
@ -43,8 +43,8 @@ int main ()
signal(SIGINT, sig_handler);
//! [Interesting]
// Instantiate a Grove Moisture sensor on analog pin A0
upm::GroveMoisture* moisture = new upm::GroveMoisture(0);
// Instantiate a Moisture sensor on analog pin A0
upm::Moisture* moisture = new upm::Moisture(0);
// Values (approximate):
// 0-300, sensor in air or dry soil