kg

Dependencies:   mbed

Revision:
0:fbf47740c05e
--- /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