Merci a tous pour vos reponse.
Je vais etre plus precis car je n'y arrive toujours pas avec votre aide.
Je récupéré le jour de la semaine, le mois, le jour et l'année et je la transforme en char pour pouvoir les faire défilé sur un afficheur.
int crtPos = 0;
int crtColor = GREEN;
int nSpeed = 3;
char* jourDeSemaine;
char* moisChar;
String msgLine;
String test = "test";
switch (jourSemaine){
case 1:
jourDeSemaine = "LUNDI";
break;
case 2:
jourDeSemaine = "MARDI";
break;
case 3:
jourDeSemaine = "MERCREDI";
break;
case 4:
jourDeSemaine = "JEUDI";
break;
case 5:
jourDeSemaine = "VENDREDI";
break;
case 6:
jourDeSemaine = "SAMEDI";
break;
case 7:
jourDeSemaine = "DIMANCHE";
break;
}
switch (mois){
case 1:
moisChar = "JANVIER";
break;
case 2:
moisChar = "FEVRIER";
break;
case 3:
moisChar = "MARS";
break;
case 4:
moisChar = "AVRIL";
break;
case 5:
moisChar = "MAI";
break;
case 6:
moisChar = "JUIN";
break;
case 7:
moisChar = "JUILLET";
break;
case 8:
moisChar = "AOUT";
break;
case 9:
moisChar = "SEPTEMBRE";
break;
case 10:
moisChar = "OCTOBRE";
break;
case 11:
moisChar = "NOVEMBRE";
break;
case 12:
moisChar = "DECEMBRE";
break;
}
for (int x=-50; x < 150; x++)
{
ht1632_putchar(-x, 8, msgLine[crtPos], crtColor);
ht1632_putchar(-x+6, 8, ((crtPos+1 < strlen(msgLine)) ? msgLine[crtPos+1] : ' '), crtColor);
ht1632_putchar(-x+12, 8, ((crtPos+2 < strlen(msgLine)) ? msgLine[crtPos+2] : ' '), crtColor);
ht1632_putchar(-x+18, 8, ((crtPos+3 < strlen(msgLine)) ? msgLine[crtPos+3] : ' '), crtColor);
ht1632_putchar(-x+24, 8, ((crtPos+4 < strlen(msgLine)) ? msgLine[crtPos+4] : ' '), crtColor);
ht1632_putchar(-x+30, 8, ((crtPos+5 < strlen(msgLine)) ? msgLine[crtPos+5] : ' '), crtColor);
ht1632_putchar(-x+36, 8, ((crtPos+6 < strlen(msgLine)) ? msgLine[crtPos+6] : ' '), crtColor);
ht1632_putchar(-x+42, 8, ((crtPos+7 < strlen(msgLine)) ? msgLine[crtPos+7] : ' '), crtColor);
ht1632_putchar(-x+48, 8, ((crtPos+8 < strlen(msgLine)) ? msgLine[crtPos+8] : ' '), crtColor);
ht1632_putchar(-x+54, 8, ((crtPos+9 < strlen(msgLine)) ? msgLine[crtPos+9] : ' '), crtColor);
ht1632_putchar(-x+60, 8, ((crtPos+10 < strlen(msgLine)) ? msgLine[crtPos+10] : ' '), crtColor);
ht1632_putchar(-x+66, 8, ((crtPos+11 < strlen(msgLine)) ? msgLine[crtPos+11] : ' '), crtColor);
ht1632_putchar(-x+72, 8, ((crtPos+12 < strlen(msgLine)) ? msgLine[crtPos+12] : ' '), crtColor);
ht1632_putchar(-x+78, 8, ((crtPos+13 < strlen(msgLine)) ? msgLine[crtPos+13] : ' '), crtColor);
ht1632_putchar(-x+84, 8, ((crtPos+14 < strlen(msgLine)) ? msgLine[crtPos+14] : ' '), crtColor);
ht1632_putchar(-x+90, 8, ((crtPos+15 < strlen(msgLine)) ? msgLine[crtPos+15] : ' '), crtColor);
ht1632_putchar(-x+96, 8, ((crtPos+16 < strlen(msgLine)) ? msgLine[crtPos+16] : ' '), crtColor);
ht1632_putchar(-x+102, 8, ((crtPos+17 < strlen(msgLine)) ? msgLine[crtPos+17] : ' '), crtColor);
ht1632_putchar(-x+108, 8, ((crtPos+18 < strlen(msgLine)) ? msgLine[crtPos+18] : ' '), crtColor);
ht1632_putchar(-x+114, 8, ((crtPos+19 < strlen(msgLine)) ? msgLine[crtPos+19] : ' '), crtColor);
ht1632_putchar(-x+120, 8, ((crtPos+20 < strlen(msgLine)) ? msgLine[crtPos+20] : ' '), crtColor);
ht1632_putchar(-x+126, 8, ((crtPos+21 < strlen(msgLine)) ? msgLine[crtPos+21] : ' '), crtColor);
ht1632_putchar(-x+132, 8, ((crtPos+22 < strlen(msgLine)) ? msgLine[crtPos+22] : ' '), crtColor);
ht1632_putchar(-x+138, 8, ((crtPos+23 < strlen(msgLine)) ? msgLine[crtPos+23] : ' '), crtColor);
ht1632_putchar(-x+144, 8, ((crtPos+24 < strlen(msgLine)) ? msgLine[crtPos+24] : ' '), crtColor);
ht1632_putchar(-x+150, 8, ((crtPos+25 < strlen(msgLine)) ? msgLine[crtPos+25] : ' '), crtColor);
delay(45 - nSpeed * 10);
}
crtPos++;
}
J'ai essayé avec string mais y veut pas non plus, y me dis cannot convert 'String' to 'const char*' for argument '1' to 'size_t strlen(const char*)'
Je crois que je fait un peu compliqué et que j'ai pas la bonne approche en fait.
Plus precisement c'est cette partie qui ne veut pas de mes String
for (int x=-50; x < 150; x++)
{
ht1632_putchar(-x, 8, msgLine[crtPos], crtColor);
ht1632_putchar(-x+6, 8, ((crtPos+1 < strlen(msgLine)) ? msgLine[crtPos+1] : ' '), crtColor);
ht1632_putchar(-x+12, 8, ((crtPos+2 < strlen(msgLine)) ? msgLine[crtPos+2] : ' '), crtColor);
ht1632_putchar(-x+18, 8, ((crtPos+3 < strlen(msgLine)) ? msgLine[crtPos+3] : ' '), crtColor);
ht1632_putchar(-x+24, 8, ((crtPos+4 < strlen(msgLine)) ? msgLine[crtPos+4] : ' '), crtColor);
ht1632_putchar(-x+30, 8, ((crtPos+5 < strlen(msgLine)) ? msgLine[crtPos+5] : ' '), crtColor);
ht1632_putchar(-x+36, 8, ((crtPos+6 < strlen(msgLine)) ? msgLine[crtPos+6] : ' '), crtColor);
ht1632_putchar(-x+42, 8, ((crtPos+7 < strlen(msgLine)) ? msgLine[crtPos+7] : ' '), crtColor);
ht1632_putchar(-x+48, 8, ((crtPos+8 < strlen(msgLine)) ? msgLine[crtPos+8] : ' '), crtColor);
ht1632_putchar(-x+54, 8, ((crtPos+9 < strlen(msgLine)) ? msgLine[crtPos+9] : ' '), crtColor);
ht1632_putchar(-x+60, 8, ((crtPos+10 < strlen(msgLine)) ? msgLine[crtPos+10] : ' '), crtColor);
ht1632_putchar(-x+66, 8, ((crtPos+11 < strlen(msgLine)) ? msgLine[crtPos+11] : ' '), crtColor);
ht1632_putchar(-x+72, 8, ((crtPos+12 < strlen(msgLine)) ? msgLine[crtPos+12] : ' '), crtColor);
ht1632_putchar(-x+78, 8, ((crtPos+13 < strlen(msgLine)) ? msgLine[crtPos+13] : ' '), crtColor);
ht1632_putchar(-x+84, 8, ((crtPos+14 < strlen(msgLine)) ? msgLine[crtPos+14] : ' '), crtColor);
ht1632_putchar(-x+90, 8, ((crtPos+15 < strlen(msgLine)) ? msgLine[crtPos+15] : ' '), crtColor);
ht1632_putchar(-x+96, 8, ((crtPos+16 < strlen(msgLine)) ? msgLine[crtPos+16] : ' '), crtColor);
ht1632_putchar(-x+102, 8, ((crtPos+17 < strlen(msgLine)) ? msgLine[crtPos+17] : ' '), crtColor);
ht1632_putchar(-x+108, 8, ((crtPos+18 < strlen(msgLine)) ? msgLine[crtPos+18] : ' '), crtColor);
ht1632_putchar(-x+114, 8, ((crtPos+19 < strlen(msgLine)) ? msgLine[crtPos+19] : ' '), crtColor);
ht1632_putchar(-x+120, 8, ((crtPos+20 < strlen(msgLine)) ? msgLine[crtPos+20] : ' '), crtColor);
ht1632_putchar(-x+126, 8, ((crtPos+21 < strlen(msgLine)) ? msgLine[crtPos+21] : ' '), crtColor);
ht1632_putchar(-x+132, 8, ((crtPos+22 < strlen(msgLine)) ? msgLine[crtPos+22] : ' '), crtColor);
ht1632_putchar(-x+138, 8, ((crtPos+23 < strlen(msgLine)) ? msgLine[crtPos+23] : ' '), crtColor);
ht1632_putchar(-x+144, 8, ((crtPos+24 < strlen(msgLine)) ? msgLine[crtPos+24] : ' '), crtColor);
ht1632_putchar(-x+150, 8, ((crtPos+25 < strlen(msgLine)) ? msgLine[crtPos+25] : ' '), crtColor);
delay(45 - nSpeed * 10);
}
crtPos++;
}
Merci