#define PORT_LED 4
#define ALLUME 1
#define ETEINT 0
#define DUREE_BASE_ALLUME 500
#define DUREE_BASE_ETEINT 500
int i=0;
//int motif[10];
int motif[]={1,1,0,1,1,0,1,1,0,1};
void setup() {
pinMode(PORT_LED, OUTPUT);
Serial.begin(9600);//Initialise le port série (pour l'affichage dans la fenêtre Moniteur)
/* motif[0] = 1;
motif[1] = 1;
motif[2] = 0;
motif[3] = 1;
motif[4] = 1;
motif[5] = 0;
motif[6] = 1;
motif[7] = 1;
motif[8] = 0;
motif[9] = 1;*/
}
void loop() {
if(i > 9) {i = 0;}
if(motif[i] == 1){
digitalWrite(PORT_LED, ALLUME); // Allume la LED
for(int k=0;k<10;k++){
delay(DUREE_BASE_ALLUME/10);
Serial.println(1);//Pour contrôle sur le moniteur
}
}
else{
digitalWrite(PORT_LED, ETEINT); // Eteint la LED
for(int k=0;k<10;k++){
delay(DUREE_BASE_ETEINT/10);
Serial.println(0);//Pour contrôle sur le moniteur
}
}
i++;
}