Example using the moisture sensor

Dependencies:   mbed

Fork of Seeed_Grove_Moisture_Sensor_Example by Seeed

Committer:
blazter94
Date:
Mon Oct 16 15:05:47 2017 +0000
Revision:
1:28a27f317a57
Parent:
0:780321a3f63a

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sam_grove 0:780321a3f63a 1
sam_grove 0:780321a3f63a 2 #include "mbed.h"
sam_grove 0:780321a3f63a 3
blazter94 1:28a27f317a57 4 AnalogIn moisture(A3);
sam_grove 0:780321a3f63a 5
sam_grove 0:780321a3f63a 6 int main(void)
sam_grove 0:780321a3f63a 7 {
sam_grove 0:780321a3f63a 8 float value = 0.0f;
sam_grove 0:780321a3f63a 9
sam_grove 0:780321a3f63a 10 while(1) {
sam_grove 0:780321a3f63a 11 value = moisture;
blazter94 1:28a27f317a57 12 printf("\nMoisture reading is %2.2f\n", value);
sam_grove 0:780321a3f63a 13 wait(1.0f);
sam_grove 0:780321a3f63a 14 }
sam_grove 0:780321a3f63a 15 }