Nathan MONNIER / Mbed 2 deprecated Projet_S3

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
dujardin
Date:
Fri Nov 25 14:55:07 2016 +0000
Parent:
4:6a1fff2aa293
Child:
6:edb27e228558
Commit message:
panneau les duj 11 2016

Changed in this revision

LED.h Show annotated file Show diff for this revision Revisions of this file
char.h Show annotated file Show diff for this revision Revisions of this file
draw.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/LED.h	Tue May 31 17:15:53 2016 +0000
+++ b/LED.h	Fri Nov 25 14:55:07 2016 +0000
@@ -36,41 +36,41 @@
     return out;
      }
    
-void bmpI(void)
-    { // cherche 32*32 dans bmp reçue, la met en I avec les offset       
-    for ( int lo = 0 ; lo < 32 ; lo++ )// Y
-        {
-        for ( int lp = 0 ; lp < 32 ; lp++ )// x 
-            { // ax ay deplacements,  dx dy position matrice  
-             int xxx= lp + dx + ax ;
-               if ( xxx > Li ) xxx= xxx- Li; // max de xxx dans Li 
-               if ( xxx > Li ) xxx= xxx- Li;
-             int yyy = lo + dy + ay ;
-               if ( yyy > Hi ) yyy= yyy- Hi; // max de yyy dans Hi 
-               if ( yyy > Hi ) yyy= yyy- Hi;
-             int jj = 4*(tabp[xxx][yyy]) ;    
-             
-             I[lp][lo][2]= lut(tabc[jj]); //b
-             jj++;
-             I[lp][lo][1]= lut(tabc[jj]); //v
-             jj++;
-             I[lp][lo][0]= lut(tabc[jj]); //r
-            } 
-        }
-    }  
-    
 void pix( int X, int Y , char cr , char cv , char cb )
     {  // place un pixel RVB dans  I en 32/32 max  x y 0 normal 
     if ( X < 0 ) X = 0;  // limites avant usage
     if ( Y < 0 ) Y = 0;
     if ( X > 31 ) X = 31;
     if ( Y > 31 ) Y = 31;
-    if ( cr > 7 ) cr = 7;  // 8 valeurs d'intensité
-    if ( cv > 7 ) cv = 7;   // 16 dernières non exploitées // max de courant
-    if ( cb > 7 ) cb = 7 ;  // TR seulement
+    if ( cr > 15 ) cr = 15;  // 8 valeurs d'intensité
+    if ( cv > 15 ) cv = 15;   // 16 dernières non exploitées // max de courant
+    if ( cb > 15 ) cb = 15 ;  // TR seulement
     I[X][Y][R] = cr;     I[X][Y][V] = cv;   I[X][Y][B] = cb;    
     }
 
+
+void circle(int px , int py , int r )  //dessine un cercle en Px Py de rayon r
+    // de couleurs dites avant en ar av ab
+    {
+     int rx = 0; int ry = 0 ;
+     for ( rx = r ;  ry <= rx ; rx-- )
+          {
+          while((rx*rx+ry*ry)<(r*r))//rayon fait < raton theorique
+               {// 8 points ( symetrie x et y en dessus et dessous
+                pix ( px+rx , py+ry , ar , av , ab );    
+                pix ( px+rx , py-ry , ar , av , ab );   
+                pix ( px-rx , py+ry , ar , av , ab );    
+                pix ( px-rx , py-ry , ar , av , ab );  
+                pix ( px+ry , py+rx , ar , av , ab );
+                pix ( px-ry , py+rx , ar , av , ab );
+                pix ( px+ry , py-rx , ar , av , ab );
+                pix ( px-ry , py-rx , ar , av , ab );
+                ry++;
+               }    
+          }     
+     // pix ( px , py , ar , av , ab );  
+    }
+
 void Taffi()
 {    // passe tableau T  vers les LEDs en 4 temps 
     for(int YY=0; YY<16; YY++)   // 2 x 16 lignes
@@ -89,17 +89,19 @@
             LAT = HIGH; // Latch  row
             LAT = LOW;
         OE = LOW; // Enable output  // version TR
-        if ( t == 0 ) wait_us(20);
-        if ( t == 1 ) wait_us(40);
-        if ( t == 2 ) wait_us(80);  
-        if ( t == 3 ) wait_us(160); // un de plus
+        if ( t == 0 ) wait_us(15);
+        if ( t == 1 ) wait_us(30);
+        if ( t == 2 ) wait_us(60);  
+        if ( t == 3 ) wait_us(120); // un de plus
         OE = HIGH; // Enable output
+        if ( all == 1 )wait_us(100);
        }
     }
 }
 
 void IversT() // prends I rvb 4 bits et le pose en T 4 temps
     {
+      varmax = 0;  // init maximum a 0
       for ( L = 0 ; L < 32 ; L++ ) // L position horizontale
          {    // I[] en 4 bits .. plus rapide a gerer à l'affichage      
               // recupère rvb en 2 ligne
@@ -108,7 +110,8 @@
             G= GG;    
             J= I[L][G][R]; K= I[L][G][V]; Q= I[L][G][B];          
             G=G+16;
-            S= I[L][G][R]; D= I[L][G][V]; F= I[L][G][B];            
+            S= I[L][G][R]; D= I[L][G][V]; F= I[L][G][B];   
+            varmax = varmax + J + K + Q + S + D + F ;         
             T0 = 0;T1 = 0; T2 = 0 ; T3 = 0;
             if ( ( J & 1 ) == 1 ) T0 = T0 + 32 ;
             if ( ( S & 1 ) == 1 ) T0 = T0 + 16 ;
@@ -139,5 +142,7 @@
             if ( ( F & 8 ) == 8 ) T3 = T3 + 1 ;
             T[L][GG][3]= T3;
             }      
-         }    
+         }   
+      if ( varmax >= 22000) all = 1; // ( moyenne a 7 )
+
     }
\ No newline at end of file
--- a/char.h	Tue May 31 17:15:53 2016 +0000
+++ b/char.h	Fri Nov 25 14:55:07 2016 +0000
@@ -1,53 +1,162 @@
 // on utilise   char rouge     charr(x,y, char )
 
+void chart( int px , int py , char ch  )
+{   // couleur atr atb atv sur fond ancien   
+    if ( ch == 'D' )
+       {
+        pix( px+ 0  , py + 0 , atr , atv, atb ); 
+        pix( px+ 1  , py + 0 , atr , atv, atb ); 
+        pix( px+ 2  , py + 0 , atr , atv, atb ); 
+        pix( px+ 3  , py + 0 , atr , atv, atb ); 
+        pix( px+ 0  , py + 1 , atr , atv, atb );
+        pix( px+ 4  , py + 1 , atr , atv, atb );       
+        pix( px+ 0  , py + 2 , atr , atv, atb );
+        pix( px+ 4  , py + 2 , atr , atv, atb );
+        pix( px+ 0  , py + 3 , atr , atv, atb );
+        pix( px+ 4  , py + 3 , atr , atv, atb );
+        pix( px+ 0  , py + 4 , atr , atv, atb );
+        pix( px+ 4  , py + 4 , atr , atv, atb );
+        pix( px+ 0  , py + 5 , atr , atv, atb );
+        pix( px+ 1  , py + 5 , atr , atv, atb );
+        pix( px+ 2  , py + 5 , atr , atv, atb );
+        pix( px+ 3  , py + 5 , atr , atv, atb );
+       }  
+       
+    if ( ch == 'R' )
+       {
+        pix( px+ 0  , py + 0 , atr , atv, atb ); 
+        pix( px+ 1  , py + 0 , atr , atv, atb ); 
+        pix( px+ 2  , py + 0 , atr , atv, atb ); 
+        pix( px+ 3  , py + 0 , atr , atv, atb ); 
+        pix( px+ 0  , py + 1 , atr , atv, atb );
+        pix( px+ 4  , py + 1 , atr , atv, atb );
+        pix( px+ 0  , py + 2 , atr , atv, atb ); 
+        pix( px+ 1  , py + 2 , atr , atv, atb ); 
+        pix( px+ 2  , py + 2 , atr , atv, atb ); 
+        pix( px+ 3  , py + 2 , atr , atv, atb ); 
+        pix( px+ 0  , py + 3 , atr , atv, atb );
+        pix( px+ 4  , py + 3 , atr , atv, atb );
+        pix( px+ 0  , py + 4 , atr , atv, atb );
+        pix( px+ 4  , py + 4 , atr , atv, atb );
+        pix( px+ 0  , py + 5 , atr , atv, atb );
+        pix( px+ 4  , py + 5 , atr , atv, atb );
+     
+       }  
+    if ( ch == 'U' )
+       {
+        pix( px+ 0  , py + 0 , atr , atv, atb ); 
+        pix( px+ 4  , py + 0 , atr , atv, atb ); 
+        pix( px+ 0  , py + 1 , atr , atv, atb );
+        pix( px+ 4  , py + 1 , atr , atv, atb );       
+        pix( px+ 0  , py + 2 , atr , atv, atb );
+        pix( px+ 4  , py + 2 , atr , atv, atb );
+        pix( px+ 0  , py + 3 , atr , atv, atb );
+        pix( px+ 4  , py + 3 , atr , atv, atb );
+        pix( px+ 0  , py + 4 , atr , atv, atb );
+        pix( px+ 4  , py + 4 , atr , atv, atb );
+        pix( px+ 1  , py + 5 , atr , atv, atb );
+        pix( px+ 2  , py + 5 , atr , atv, atb );
+        pix( px+ 3  , py + 5 , atr , atv, atb );
+       } 
+    if ( ch == 'C' )
+       {
+        pix( px+ 1  , py + 0 , atr , atv, atb ); 
+        pix( px+ 2  , py + 0 , atr , atv, atb ); 
+        pix( px+ 3  , py + 0 , atr , atv, atb ); 
+        pix( px+ 0  , py + 1 , atr , atv, atb );
+        pix( px+ 4  , py + 1 , atr , atv, atb );
+        pix( px+ 0  , py + 2 , atr , atv, atb );
+        pix( px+ 0  , py + 3 , atr , atv, atb );
+        pix( px+ 0  , py + 4 , atr , atv, atb );
+        pix( px+ 4  , py + 4 , atr , atv, atb );
+        pix( px+ 1  , py + 5 , atr , atv, atb );
+        pix( px+ 2  , py + 5 , atr , atv, atb );
+        pix( px+ 3  , py + 5 , atr , atv, atb );
+       }    
+       
+    if ( ch == 'G' )
+       {
+        pix( px+ 1  , py + 0 , atr , atv, atb ); 
+        pix( px+ 2  , py + 0 , atr , atv, atb ); 
+        pix( px+ 3  , py + 0 , atr , atv, atb ); 
+        pix( px+ 0  , py + 1 , atr , atv, atb );
+        pix( px+ 4  , py + 1 , atr , atv, atb );
+        pix( px+ 0  , py + 2 , atr , atv, atb );
+        pix( px+ 0  , py + 3 , atr , atv, atb );
+        pix( px+ 2  , py + 3 , atr , atv, atb );
+        pix( px+ 3  , py + 3 , atr , atv, atb );
+        pix( px+ 4  , py + 3 , atr , atv, atb );
+        pix( px+ 0  , py + 4 , atr , atv, atb );
+        pix( px+ 4  , py + 4 , atr , atv, atb );
+        pix( px+ 1  , py + 5 , atr , atv, atb );
+        pix( px+ 2  , py + 5 , atr , atv, atb );
+        pix( px+ 3  , py + 5 , atr , atv, atb );
+       }
+    if ( ch == 'E' )
+       {
+        pix( px+ 0  , py + 0 , atr , atv, atb ); 
+        pix( px+ 1  , py + 0 , atr , atv, atb ); 
+        pix( px+ 2  , py + 0 , atr , atv, atb ); 
+        pix( px+ 3  , py + 0 , atr , atv, atb ); 
+        pix( px+ 4  , py + 0 , atr , atv, atb );
+        pix( px+ 0  , py + 1 , atr , atv, atb );
+        pix( px+ 0  , py + 2 , atr , atv, atb );
+        pix( px+ 0  , py + 3 , atr , atv, atb );
+        pix( px+ 1  , py + 3 , atr , atv, atb );
+        pix( px+ 2  , py + 3 , atr , atv, atb ); 
+        pix( px+ 3  , py + 3 , atr , atv, atb );
+        pix( px+ 0  , py + 4 , atr , atv, atb );
+        pix( px+ 0  , py + 5 , atr , atv, atb ); 
+        pix( px+ 1  , py + 5 , atr , atv, atb );
+        pix( px+ 2  , py + 5 , atr , atv, atb );
+        pix( px+ 3  , py + 5 , atr , atv, atb );
+        pix( px+ 4  , py + 5 , atr , atv, atb );
+       }
+    if ( ch == 'I' )
+       {
+        pix( px+ 0  , py + 0 , atr , atv, atb ); 
+        pix( px+ 1  , py + 0 , atr , atv, atb ); 
+        pix( px+ 2  , py + 0 , atr , atv, atb ); 
+        pix( px+ 3  , py + 0 , atr , atv, atb ); 
+        pix( px+ 4  , py + 0 , atr , atv, atb );
+        pix( px+ 2  , py + 1 , atr , atv, atb );
+        pix( px+ 2  , py + 2 , atr , atv, atb );
+        pix( px+ 2  , py + 3 , atr , atv, atb );
+        pix( px+ 2  , py + 4 , atr , atv, atb );
+        pix( px+ 0  , py + 5 , atr , atv, atb ); 
+        pix( px+ 1  , py + 5 , atr , atv, atb );
+        pix( px+ 2  , py + 5 , atr , atv, atb );
+        pix( px+ 3  , py + 5 , atr , atv, atb );
+        pix( px+ 4  , py + 5 , atr , atv, atb );
+       }
+    if ( ch == 'T' )
+       {
+        pix( px+ 0  , py + 0 , atr , atv, atb ); 
+        pix( px+ 1  , py + 0 , atr , atv, atb ); 
+        pix( px+ 2  , py + 0 , atr , atv, atb ); 
+        pix( px+ 3  , py + 0 , atr , atv, atb ); 
+        pix( px+ 4  , py + 0 , atr , atv, atb );
+        pix( px+ 2  , py + 1 , atr , atv, atb );
+        pix( px+ 2  , py + 2 , atr , atv, atb );
+        pix( px+ 2  , py + 3 , atr , atv, atb );
+        pix( px+ 2  , py + 4 , atr , atv, atb );
+        pix( px+ 2  , py + 5 , atr , atv, atb );
+       }
+    if ( ch == 'Y' )
+       {
+        pix( px+ 0  , py + 0 , atr , atv, atb ); 
+        pix( px+ 4  , py + 0 , atr , atv, atb );
+        pix( px+ 1  , py + 1 , atr , atv, atb ); 
+        pix( px+ 3  , py + 1 , atr , atv, atb );
+        pix( px+ 2  , py + 2 , atr , atv, atb );
+        pix( px+ 2  , py + 3 , atr , atv, atb );
+        pix( px+ 2  , py + 4 , atr , atv, atb );
+        pix( px+ 2  , py + 5 , atr , atv, atb );
+       }
+}
+
 void charr( int px , int py , char ch  )
-    {
-        
-    if ( ch == 'y' )
-       {
-        pix( px+ 0  , py + 0 , 5 , 0 , 0 ); 
-        pix( px+ 1  , py + 0 , 0 , 0 , 0 ); 
-        pix( px+ 2  , py + 0 , 0 , 0 , 0 ); 
-        pix( px+ 3  , py + 0 , 0 , 0 , 0 ); 
-        pix( px+ 4  , py + 0 , 5 , 0 , 0 ); 
-        
-        pix( px+ 0  , py + 1 , 0 , 0 , 0 ); 
-        pix( px+ 1  , py + 1 , 5, 0 , 0 ); 
-        pix( px+ 2  , py + 1 , 0 , 0 , 0 ); 
-        pix( px+ 3  , py + 1 , 5 , 0 , 0 ); 
-        pix( px+ 4  , py + 1 , 0 , 0 , 0 ); 
-        
-        pix( px+ 0  , py + 2 , 0 , 0 , 0 ); 
-        pix( px+ 1  , py + 2 , 0 , 0 , 0 ); 
-        pix( px+ 2  , py + 2 , 5 , 0 , 0 ); 
-        pix( px+ 3  , py + 2 , 0 , 0 , 0 ); 
-        pix( px+ 4  , py + 2 , 0 , 0 , 0 ); 
-        
-        pix( px+ 0  , py + 3 , 0 , 0 , 0 ); 
-        pix( px+ 1  , py + 3 , 0 , 0 , 0 ); 
-        pix( px+ 2  , py + 3 , 5 , 0 , 0 ); 
-        pix( px+ 3  , py + 3 , 0 , 0 , 0 ); 
-        pix( px+ 4  , py + 3 , 0 , 0 , 0 );
-        
-        pix( px+ 0  , py + 4 , 0 , 0 , 0 ); 
-        pix( px+ 1  , py + 4 , 0 , 0 , 0 ); 
-        pix( px+ 2  , py + 4 , 5 , 0 , 0 ); 
-        pix( px+ 3  , py + 4 , 0 , 0 , 0 ); 
-        pix( px+ 4  , py + 4 , 0 , 0 , 0 );
-        
-        pix( px+ 0  , py + 5 , 0 , 0 , 0 ); 
-        pix( px+ 1  , py + 5 , 0, 0 , 0 ); 
-        pix( px+ 2  , py + 5 , 5,  0 , 0 ); 
-        pix( px+ 3  , py + 5 , 0 , 0 , 0 ); 
-        pix( px+ 4  , py + 5 , 0 , 0 , 0 );
-    
-        pix( px+ 0  , py + 6 , 0 , 0 , 0 ); 
-        pix( px+ 1  , py + 6 , 0 , 0 , 0 ); 
-        pix( px+ 2  , py + 6 , 0 , 0 , 0 ); 
-        pix( px+ 3  , py + 6 , 0 , 0 , 0 ); 
-        pix( px+ 4  , py + 6 , 0 , 0 , 0 );
-       }
-        
+    {       
     if ( ch == 'x' )
        {
         pix( px+ 0  , py + 0 , 5 , 0 , 0 ); 
@@ -365,7 +474,7 @@
      
     if ( ch == 6 )
        {
-        pix( px+ 0  , py + 0 , 5 , 0 , 0 ); 
+        pix( px+ 0  , py + 0 , 0 , 0 , 0 ); 
         pix( px+ 1  , py + 0 , 5 , 0 , 0 ); 
         pix( px+ 2  , py + 0 , 5 , 0 , 0 ); 
         pix( px+ 3  , py + 0 , 0 , 0 , 0 ); 
@@ -546,7 +655,7 @@
   
 
     
-void ptnum(int px , int py , int num ) 
+void ptnum2(int px , int py , int num ) 
    {
        int dix ;
        int un ;
@@ -554,9 +663,31 @@
        dix = num / 10 ; 
        un = num - 10*dix;
        charr ( px , py , dix );
-       charr ( px + 5 , py , un );
-       //charr('e');
-       
-       
+       charr ( px + 5 , py , un ); 
    }
+   
+void ptint( int py , int num ) 
+   {   int px = 1;
+       int rest ;
+       int dmil ;
+       int mil;
+       int cent;
+       int dix ;
+       int un ;
+       dmil = num /10000; 
+       rest = num - 10000*dmil;
+       mil = rest/1000;
+       rest = rest - 1000*mil;
+       cent = rest/100;
+       rest = rest - 100*cent;    
+       dix = rest/10;
+       un = rest - 10*dix;  
+       charr ( px ,     py , dmil );
+       charr ( px + 5 , py , mil  ); 
+       charr ( px + 10, py , cent );
+       charr ( px + 15, py , dix  ); 
+       charr ( px + 20, py , un   ); 
+   }
+   
+   
 
--- a/draw.h	Tue May 31 17:15:53 2016 +0000
+++ b/draw.h	Fri Nov 25 14:55:07 2016 +0000
@@ -1,52 +1,56 @@
-// lieu de vos  variables 
-// NOM commençant par un 'a'  comme  atiti 
-int atiti = 5;
-int ar ; int ab ; int av ;
-
-// lieu de vos fonctions ..appelées plus bas
+// lieu de vos  variables ( les faire commencer par un a 
+int atiti = 0;
 
-void circle(int px , int py , int r ) 
-    {
-     int rx = 0; int ry = 0 ;
-     for ( rx = r ;  ry <= rx ; rx-- )
-          {
-          while((rx*rx+ry*ry)<(r*r))
-               {
-                pix ( px+rx , py+ry , ar , av , ab );    
-                pix ( px+rx , py-ry , ar , av , ab );   
-                pix ( px-rx , py+ry , ar , av , ab );    
-                pix ( px-rx , py-ry , ar , av , ab );  
-                pix ( px+ry , py+rx , ar , av , ab );
-                pix ( px-ry , py+rx , ar , av , ab );
-                pix ( px+ry , py-rx , ar , av , ab );
-                pix ( px-ry , py-rx , ar , av , ab );
-                ry++;
-               }    
-          }
-      
-      pix ( px , py , ar , av , ab );  
-    }
+// lieu de vos fonctions ..qui seront appelées plus bas dans votre draw
 
 
-void draw()   // exemple d'une chose a faire ( pas de delai dans cette boucle)
+void draw()   // boucle répétée chauqe 30 ms 
   { 
-    pix(15+accx,15+accy,0,0,7);  // pixel bleu en x = 5+4  et y = 1
-    
-    ar = 5 ; av = 0 ; ab = 0;
+   /* ar = 5 ; av = 0 ; ab = 0;
     accx = abs(accx);
     circle ( 15 , 15 , accx );
+    ar = 0 ; av = 5 ; ab = 0;
+    accy = abs(accy);
+    circle ( 15 , 15 , accy );
     
+
+    atr = 0 ; atv = 10 ; atb = 0;
+    chart(6,13,'G');
+    atr = 0 ; atv = 0 ; atb = 15;
+    chart(11,13,'E');
+    atr = 9 ; atv = 0 ; atb = 0;
+    chart(16,13,'I');
+    atr = 7; atv = 7 ; atb = 7;
+    chart(21,13,'I');
+    atr = 8 ; atv = 0 ; atb = 5;
+    chart(10,1,'D');
+    atr = 7; atv = 7 ; atb = 0;
+    chart(15,1,'U');
+    atr = 0 ; atv = 9 ; atb = 3;
+    chart(20,1,'T');
+    atr = 14 ; atv = 14; atb = 14;
+    chart(2,24,'C');
+    chart(8,24,'E');
+    chart(14,24,'R');
+    chart(20,24,'G');
+    chart(26,24,'Y');   */
+    pix(15,15,5,2,4);
   }
   
-  //  voici les 3 fonctions utilisables 
-  
+  //   fonctions  pré existantes ( utilisant des entiers )
   // pix ( x , y , r , v , b )   dessine un pixel de couleur en xy
-  // x et y position du pixel à dessiner ( 0 à 31 )
-  // r v b  quantité de 0 à 7 du r v b ..  7 c'est lumineux 
+  //         x et y position du pixel à dessiner ( 0 à 31 )
+  //         r v b  quantité de 0 à 7 du r v b ..  7 c'est lumineux 
+  // ptnum2(x, y , nombre ) écrit un nombre a la  position x y matrice
+  //        nombre ou variable .. un entier  compris entre 0 et 99  
+  // ptint ( y , nombre ) ecrit entier ( 5 chiffres ) x = 1
+  // circle(int px , int py , int r )
+  //         px et py position xy du cercle de rayon r , avec ar av ab
+  // charr ( x y 'char')ecrire car rouge sur fond noir ( x 0 1 2 3 4 5 6 7 8 9 )
+  // chart ( x y 'char')ecrire car couleur atr atb atv sur fond existant ( GEI)
+  // 
   
-  // ptnum(x, y , nombre )   écrit un nombre a la  position x y 
-  // x et y  position ou ecrire ( 0 a 31)
-  // nombre ou variable .. un entier  compris entre 0 et 99 
-  
-  // accx accy  int de -15 à +15 acceleration xy
-  // à tester  pix(15+accx,15+accy,0,0,5); ( il faut l'extension
\ No newline at end of file
+  //   Variables pré existantes utilisables 
+  //         accx accy  int de -15 à +15 copie de l'acceleration xy 
+  //         ar av ab   int porteur des couleurs à utiliser ( 0 à 7) en cercle
+  //         atr atv atb int porteur des couleurs à utiliser ( 0 à 7)en texte
\ No newline at end of file
--- a/main.cpp	Tue May 31 17:15:53 2016 +0000
+++ b/main.cpp	Fri Nov 25 14:55:07 2016 +0000
@@ -11,8 +11,6 @@
 
 AnalogIn canx(PC_4);AnalogIn cany(PB_1); DigitalOut plus(PB_15); //adxl335
 
-DigitalOut sd(PC_9);
-Serial serie(NC, PC_7);  // tx, rx  
 BusOut ABCD(PA_14,PB_0,PA_15,PC_1); // version 32/32  nucleo f401 
 BusOut RVB(PA_7,PA_5,PA_4,PA_1,PA_6,PA_0);  // RVB  ( R a droite )un seul a ecrire
 DigitalOut CLK(PC_2);    //  Data clock    - rising edge
@@ -20,46 +18,34 @@
 DigitalOut OE(PC_3);     //  Output enable - active low (hold high during data load, bring low after LAT pulse)
 
 char T[32][16][4]; // Tampon affichage 4 temps  R1R2V1V2B1B2 32x32 (2*16 )
-char I[32][32][3]; // Y X rvb .. Image 32x32 en RVB   0 à 15 0: noir 
+char I[32][32][3]; // Y X rvb .. Image 32x32 en RVB   0 à 15   0: noir 
 int  L; int M ; int O ; //    variables globales idiotes
 char J; char K ; char Q; char S ; char D;  char F; // variables à la con
 char G; char H ; char GG;
 char T0 ; char T1 ; char T2 ; char T3;
-int arr ; int prim ; int ptdat ;// arr char arrivé,  prim temoin inactivité; ptdata nombre d'octet a recevoir ..
-char rect[55];          // rec et commende 55 octets max
-char tabc[1024] ;       // pour y placer 256x4 =  r+v+b+1
-char tabp[200][200];    // pour y placer les pixels arrives ici 200/200
-long  ptfin ; // pointeur fin ( 2 + 256 3 + 256*256* 4 )
 int pt1 ; int pt2 ; int pt3 ;int pt4 ;
-int pttr ; int pttv ; int pttb; 
-int etat ; // etat des actions a faire .. draw .. bmp .. ..
-int com ; int com1 ; int com2 ; int com3 ; int com4 ; int ordrefait ; // com et passage parrametre commande 
-int longtempsa0 ; int trop ; // indique très longtemps sans RX ?? que faire ? on verra 
-int Li ; int Hi ;// indicateurs : taille, largeur, hauteur
 int dx ; int dy ; // position du 32/32 dans l'image li hi
 int ax ; int ay ;  int comf ;  // ax offset en plus de dx et dy 
 char pixt ; int rr; int vv ; int bb ; // pour des couleurs
-int ptx; int pty ; int xx ; int yy ; // utile dans recv > 1078
-int bcl ;
 float xin; float yin;  // lecture accelero
 int accx ; int accy ;  // acceleration
+int ar; int av ; int ab ;     //couleurs de dessin
+int atr ; int atv ; int atb ; // couleurs du texte 
+int varmax;  int all ;//limite  maximum pour eclairage all = 1 limite temps
       
-#include "LED.h"       // transferts LED <>401
-#include "char.h"     // transfert RX 401<>1768
-#include "draw.h"  // le tableau effectue un programme dans draw
+#include "LED.h"      // gestion e/s vers matrice a led
+#include "char.h"     // ecriture texte
+#include "draw.h"     // le tableau effectue votre  programme dansce draw
 
 //***************************************************fin wdt
 void init ()
-   {
- 
-    prim =  3;    // compteur de vides de rx 
-    ptfin = 54 ;  // preset au cas ou trame de commande  
+   {all = 0  ; // pas de limite expo
+    atr = 0 ; atv = 5 ; atb = 0 ;  // couleur texte rouge
+    ar = 0  ; av = 0 ; ab = 0 ; // couleur dessin noir
     dx = 0 ; dy = 0 ; // recherche adresse du tableau dans un 8*8
     ax = 0 ; ay = 0; // offset a ajouter a dx et dy pour mouvement
-   // etat = 'd' ; // d draw état natif au reveil
     Tr();  // efface T
     Ir();  // efface I
-    ordrefait = 0;
     plus = HIGH ;
    }
 
@@ -71,7 +57,8 @@
 while(1)  // boucle sans fin ( temps d'execution 30 ms )
     {  
     xin = canx.read(); yin= cany.read(); 
-    accx = xin * 150-75; accy = yin * 150 - 75 ;      
+  //  accx = xin * 150-75; accy = yin * 150 - 75 ;      
+    accx = xin * 1500-750; accy = yin * 1500 - 750 ;  // on amplifie !
     draw();  //   dans draw.h c'est le lieu de votre programme en Tr
            
     IversT();   // recharge votre image I  vers T