Loup Langard / Mbed 2 deprecated base_mbed_SAE1_S2-V0

Dependencies:   mbed

Revision:
11:fa0f1787ea13
Parent:
10:32b5218ff304
Child:
12:09b5ebdca214
--- a/main.cpp	Sun Jan 26 15:20:30 2020 +0000
+++ b/main.cpp	Sat Mar 28 15:50:27 2020 +0000
@@ -67,8 +67,8 @@
     pc.attach(&interrupt, Serial::RxIrq);  // autorise IT de liaison serie 
     pol = 1;            // polarisation résistancesde l' I2C  
     LL = 0 ;            // led du L432 on
-    out1.write(0.5);    // sortie ana A3 = 0.5 * 3.3V  soit 1.6 V
-    out2.write(0.25);   // sortie ana A4 = 0.25* 3.3V  soit 0.8 V
+    out1.write(0.25);    // sortie si ana A3 = 0.5 * 3.3V  soit 1.6 V
+    out2.write(0.25);   // sortie ana si A4 = 0.25* 3.3V  soit 0.8 V
     IO = 0 ;            // sortie I/O  mise à 0  
     }
     
@@ -78,10 +78,11 @@
     
     while(1)        // boucle sans fin 
         {
-        LL = !LL  ;       //inverse led carte  mbed
-        wait(0.5);      // delai 0.5s
-        XX = XX + 1 ; YY = YY - 1;
-        
+        LL = !LL  ;     //inverse led carte  mbed
+        wait(0.1);      // delai 0.1s
+        XX =  Ch1.read_u16()/16 ;// read_u16 donne 12bits ijustifiés a gauche
+        YY =  Ch2.read_u16()/16; // on divise par 16 pour faire de 0 à 4095 12bits
+        //  attention 
 //exemple 1 ) Tranfert de deux int : XX et XX  en ascii ( base hexa)en DUJ2
       pc.putc('i');          // pointeur 1 = 0
       trad(XX);  // traduit un int XX en 4 ascii en hexa