Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of Dragonfly_AnalogIn_Example by
Diff: main.cpp
- Revision:
- 0:436a6a6b80a1
- Child:
- 1:ceddded7137c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Oct 02 13:35:19 2015 +0000 @@ -0,0 +1,22 @@ +/** Dragonfly AnalogIn Example Program + * + * This program demonstrates how to read an anglog pin using the + * MultiTech Dragonfly and MultiTech UDK2 hardware. The only + * additional hardware required is an analog voltage source like + * a potentiometer. + * + * + * This program reads the analog input connected to pin A0 and + * prints the result. + */ + +#include "mbed.h" + +int main() { + AnalogIn in(A0); + + while (true) { + printf("analog value: 0x%04X\r\n", in.read_u16()); + wait_ms(500); + } +} \ No newline at end of file