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.
Revision 0:74646ad55e99, committed 2009-10-10
- Comitter:
- simon
- Date:
- Sat Oct 10 22:14:46 2009 +0000
- Commit message:
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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sat Oct 10 22:14:46 2009 +0000
@@ -0,0 +1,22 @@
+// AnalogIn reading 16-bit samples
+
+#include "mbed.h"
+
+AnalogIn input(p20);
+DigitalOut led1(LED1);
+
+int main() {
+ unsigned short samples[1024];
+
+ for(int i=0; i<1024; i++) {
+ samples[i] = input.read_u16();
+ wait_ms(1);
+ }
+
+ printf("Results:\n");
+ for(int i=0; i<1024; i++) {
+ if (samples[i] > 0x100) {
+ printf("%d, 0x%04X\n", i, samples[i]);
+ }
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Oct 10 22:14:46 2009 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a0336ede94ce