Note de ce sujet :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5
Ecran 480x320
#1
Bonjour André,

Pourriez-vous me commenter toutes les lignes ci-dessous, car j'ai un écran déporté de 480X320 et je ne comprends pas le code afin de le dimensionner à mon écran.

void TraceCourbe() {
  RempliFond();
  TraceTarif();
  int Pmin = -10;
                                              //Pmin= -10 ?
  int Pmax = 10;                                               
// Pmax=  10 ?
  int i;
  int heure;
  for (i = 0; i < 240; i++) {                                  
//240 ?
    Pmin = min(Pmin, tabPw[i]);
    Pmax = max(Pmax, tabPw[i]);
  }
  Pmax = 1.05 * max(Pmax, -Pmin);                              
// Pmax=1.05 * max(Pmax,Pmin) ?
  Pmin = -Pmax;                                               
// Pmin = -Pmax ?
  int idx = (idxPw + 1) % 240;
                                 // int idx = (idxPw + 1) % 240;
  ;
  int X0 = 0;
  int Y0 = map(tabPw[idx], Pmin, Pmax, 135, 0);                
// int Y0 = map(tabPw[idx], Pmin, Pmax, 135, 0) ? le 135 ?
  for (i = 1; i < 240; i++) {
    int X1 = i;
    idx = (idx + 1) % 240//240 ?
    int Y1 = map(tabPw[idx], Pmin, Pmax, 135, 0);             
// int Y1 = map(tabPw[idx], Pmin, Pmax, 135, 0) ?  le 135 ?
    tft.drawLine(X0, Y0, X1, Y1, C16disp_Graph);
    X0 = X1; //  X0 = X1 ?
    Y0 = Y1; //  Y0 = Y1 ?
  }
  tft.setFreeFont(FS9);
  tft.setTextColor(C16disp_Texte, C16disp_FondCourant);
  tft.drawString("W", 8, 3, 1);
  tft.setTextColor(C16disp_Texte, C16disp_FondCourant);
  int X1;
  for (i = 0; i <= 4; i++) {                                 
// for (i = 0; i <= 4; i++) { ?
    heure = -i * 8;//  heure = -i * 8;
    X0 = 240 - i * 48;                                        
// X0 = 240 - i * 48 à quoi correspond 240?
    X1 = X0 - 10;                                             
// X1 = X0 - 10 ?
    tft.drawString(String(heure) + "h", X1, 80, 1);
    tft.drawLine(X0, 67, X0, 70, C16disp_Texte);
  }
}


En vous remerciant pour votre énorme travail.
Répondre


Messages dans ce sujet
Ecran 480x320 - par Alain H - Hier, 12:19 PM
RE: Ecran 480x320 - par F1ATB - Hier, 02:05 PM
RE: Ecran 480x320 - par Alain H - Il y a 5 heures

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)