Example of measuring an alcohol sensor
Dependencies: mbed
Revision 0:ac502eed91bf, committed 2014-08-15
- Comitter:
- sam_grove
- Date:
- Fri Aug 15 21:25:14 2014 +0000
- Commit message:
- Initial commit
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r ac502eed91bf main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Aug 15 21:25:14 2014 +0000 @@ -0,0 +1,19 @@ + +#include "mbed.h" + +DigitalOut heater(A1); +AnalogIn sensor(A0); + +int main(void) +{ + float value = 0.0f; + heater = 1; + wait(0.1f); + + while(1) { + heater = 0; + value = sensor; + printf("Sensor is: %2.2f\n", value); + wait(1.0f); + } +}
diff -r 000000000000 -r ac502eed91bf mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Aug 15 21:25:14 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9327015d4013 \ No newline at end of file