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 #include "mbed.h" 00002 DigitalOut led1(LED1); 00003 Serial pc(USBTX, USBRX); 00004 Timer t1; 00005 int tt1, tt2; 00006 //InterruptIn event(A1); 00007 AnalogIn volt(PB_13); 00008 float ADCdata; 00009 int histo[10] = {0}; 00010 void coucou(){ 00011 int i1 = volt.read()+ 1; 00012 histo[i1] = histo[i1] + 1; 00013 tt1 = t1.read_us(); 00014 tt2 = t1.read_us(); 00015 // pc.printf(" y %d", volt.read()); 00016 } 00017 int main() { 00018 // event.rise(&coucou); 00019 while(1){ 00020 t1.start(); 00021 tt1 = t1.read_us(); 00022 ADCdata = floor(volt.read()*4096); 00023 t1.stop(); 00024 tt2 = t1.read_us(); 00025 pc.printf(" coucou %f \n\r", ADCdata); 00026 //pc.printf(" 0x%04X\n", volt.read()*4096); 00027 led1 = !led1; 00028 led1 = !led1; 00029 00030 pc.printf(" %d us",tt2-tt1); 00031 //pc.printf("ss %d",count); 00032 led1 = !led1; 00033 wait(1); 00034 } 00035 }
Generated on Tue Jul 26 2022 15:51:00 by
1.7.2