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 AnalogIn_HelloWorld_WIZwiki-W7500 by
Diff: main.cpp
- Revision:
- 2:5f564266c94f
- Parent:
- 0:101a12a915c6
- Child:
- 3:abab0082e271
diff -r 0a8f602aeec9 -r 5f564266c94f main.cpp
--- a/main.cpp Wed Dec 10 16:19:08 2014 -0600
+++ b/main.cpp Thu Jul 02 06:32:51 2015 +0000
@@ -26,15 +26,15 @@
// test the voltage on the initialized analog pin
// and if greater than 0.3 * VCC set the digital pin
// to a logic 1 otherwise a logic 0
- if(ain > 0.3f) {
+ if(ain > 0.5f) {
dout = 1;
} else {
dout = 0;
}
// print the percentage and 16 bit normalized values
- printf("percentage: %3.3f%%\n", ain.read()*100.0f);
- printf("normalized: 0x%04X \n", ain.read_u16());
- wait(0.2f);
+ printf("percentage: %3.3f%%\r\n", ain.read()*100.0f);
+ printf("analog value : %3.3f\r\n", ain.read());
+ wait(1.0);
}
}
