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.
main.cpp
00001 // AnalogIn reading 16-bit samples 00002 00003 #include "mbed.h" 00004 00005 AnalogIn input(p20); 00006 DigitalOut led1(LED1); 00007 00008 int main() { 00009 unsigned short samples[1024]; 00010 00011 for(int i=0; i<1024; i++) { 00012 samples[i] = input.read_u16(); 00013 wait_ms(1); 00014 } 00015 00016 printf("Results:\n"); 00017 for(int i=0; i<1024; i++) { 00018 if (samples[i] > 0x100) { 00019 printf("%d, 0x%04X\n", i, samples[i]); 00020 } 00021 } 00022 }
Generated on Thu Jul 14 2022 15:53:39 by
1.7.2