![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
kg
Dependencies: mbed
Revision 0:fbf47740c05e, committed 2017-02-06
- Comitter:
- mexinguer
- Date:
- Mon Feb 06 13:17:23 2017 +0000
- Commit message:
- gfdgr
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 Mon Feb 06 13:17:23 2017 +0000 @@ -0,0 +1,32 @@ +#include "mbed.h" +//#include "c12632.h" + +DigitalOut LED(D13); +DigitalIn BP(PC_13,PullNone); +AnalogIn pot1(PA_0); +Serial pc(SERIAL_TX, SERIAL_RX); + +int main() +{ + unsigned char cpt=0; + pc.baud(38400); + int temps_us, mesure; + Timer t; + + + while(1) + { + t.start(); + cpt++; + mesure=pot1.read_u16(); + + if(cpt==10) + { + t.stop(); + temps_us=t.read_us(); + pc.printf("%d \n",temps_us); + cpt=0; + t.reset(); + } + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Feb 06 13:17:23 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/ad3be0349dc5 \ No newline at end of file