Moisture Sensor example for WIZwiki-W7500

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 Serial pc(USBTX, USBRX);
00003 AnalogIn moisture(A0);
00004 
00005 int main(void)
00006 {
00007     float value = 0.0f;
00008 
00009     while(1) {
00010         value = moisture.read();
00011         pc.printf("Moisture reading is %2.2f\n", value);
00012         wait(1.0f);
00013     }
00014 }