Freedom Seeed Grove Alcohol Example

Dependencies:   mbed

Fork of frdm_Grove_Alcohol_Example by Freescale

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 
00002 #include "mbed.h"
00003 
00004 DigitalOut heater(A1);
00005 AnalogIn sensor(A0);
00006 
00007 int main(void)
00008 {
00009     float value = 0.0f;
00010     heater = 1;
00011     wait(0.1f);
00012     
00013     while(1) {
00014         heater = 0;
00015         value = sensor;
00016         printf("Sensor is: %2.2f\n", value);
00017         wait(1.0f);
00018     }
00019 }