Example using Electricity sensor

Dependencies:   mbed

Fork of Seeed_Grove_Moisture_Sensor_Example by Seeed

Committer:
sam_grove
Date:
Sat Aug 16 00:45:51 2014 +0000
Revision:
1:894d3b3f26e8
Parent:
0:780321a3f63a
Initial commit

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
sam_grove 1:894d3b3f26e8 4 AnalogIn electricity(A0);
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 1:894d3b3f26e8 11 value = electricity;
sam_grove 1:894d3b3f26e8 12 printf("AC Current reading is %2.2f\n", value);
sam_grove 0:780321a3f63a 13 wait(1.0f);
sam_grove 0:780321a3f63a 14 }
sam_grove 0:780321a3f63a 15 }