I've tried this code
int ledPin = 13;
// init poeme
int jour = 0;
int nJour = 17;
int mois = 2;
int an = 2;
char *chaine = " ";
char *ligne = " ";
int jMax[] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
char *sJour[33] = {"", " premier", " deux", " trois", " quatre", " cinq", " six", " sept", " huit", " neuf", " dix", " onze", " douze", " treize", " quatorze", " quinze", " seize", " dix-sept", " dix-huit", " dix-neuf", " vingt", " vingt-et-un", " vingt-deux", " vingt-trois", " vingt-quatre", " vingt-cinq", " vingt-six", " vingt-sept", " vingt-huit", " vingt-neuf", " trente", " trente-et-un", " mille"};
char *sMois[13] = {"", " janvier", " fevrier", " mars", " avril", " mai", " juin", " juillet", " aout", " septembre", " octobre", " novembre", " decembre"};
char *sAnnee[8] = {"", ""," deux mille deux", " deux mille trois", " deux mille quatre", " deux mille cinq", " deux mille six"};
char *sNomJour[7] = {"dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"};
void setup (void) {
Serial.begin(115200);
pinMode(ledPin, OUTPUT);
}
void loop (void) {
int i = 0;
int j = 0;
if (jour > 6) {jour = 0;}
if (nJour > jMax[mois]) {nJour = 1; mois++;}
if (mois == 2 && an == 3) { jMax[2] = 29;} else { jMax[2] = 28;}
if (mois > 12) {mois = 1; an++;}
// concatenation des chaines
//*chaine = " ";
strcpy(chaine, sNomJour[jour]); // dimanche
strcat(chaine, sJour[nJour]); // dix-sept
strcat(chaine, sMois[mois]); // Février
strcat(chaine, sJour[2]); // deux
strcat(chaine, sJour[32]);// mille
strcat(chaine, sJour[an]); // deux
Serial.print(chaine);
Serial.println();
jour++;
nJour++;
// ecriture des lignes
strncpy(ligne,chaine,16);
if (strlen(ligne) >= 16) {
ligne[16] = '\0';
}
// ecrit la ligne
//Serial.print(ligne);
Serial.print(ligne);
Serial.println();
delay(100);
//*ligne=" ";
for (i=2; i<=4;i++) {
strncpy(ligne,&chaine[16*(i-1)],16);
if (strlen(ligne) >= 16) {
ligne[16] = '\0';
}
// ecrit la ligne
//Serial.print(ligne);
Serial.print(ligne);
Serial.println();
delay(100);
//*ligne=" ";
}
digitalWrite(ledPin, HIGH); // sets the LED on
delay(1000); // waits for a second
digitalWrite(ledPin, LOW); // sets the LED off
delay(1000);
}
no compilation error
done uploading
but nothing appear on the serial monitor window and no blinking led
what's wrong ?
regards
eric