int LED_RED = 13;
int LED_GREEN = 11;
int LED_BLUE = 10;
struct RGB {
// aqui eu declaro minha registro
bool red;
bool green;
bool blue;
};
/*struct dado {
char nome;
int idade;
int nota;
};*/
//dado pessoa;
RGB colors[] = {
{HIGH,LOW,LOW}, // primeira cor
{HIGH,HIGH,LOW},
{LOW,HIGH,LOW}, //cor verde
{HIGH,HIGH,HIGH},
{HIGH,LOW,HIGH},
{HIGH,LOW,HIGH},
{HIGH,HIGH,HIGH},
};
//int vetor[3] = {LED_RED,LED_GREEN,LED_BLUE};
void setup() {
// put your setup code here, to run once:
pinMode(LED_RED, OUTPUT);
pinMode(LED_GREEN, OUTPUT);
pinMode(LED_BLUE, OUTPUT);
// escrever um laço for para declaraçao dos pinos
/*
for(int i = 0; i< 3; i++){
pinMode(vetor[i], OUTPUT);
}*/
}
int duracao[] = {
1000,
500,
300,
500,
1000,
1000,
500
};
void loop() {
int tamanho = sizeof(colors)/sizeof(colors[0]);
for(int i = 0; i < tamanho; i++){
setColors(colors[i].red,colors[i].green,colors[i].blue, duracao[i]);
}
}
void setColors(int estado_red, int estado_green, int estado_blue, int tempo){
digitalWrite(LED_RED,estado_red);
digitalWrite(LED_GREEN,estado_green);
digitalWrite(LED_BLUE,estado_blue);
delay(tempo);
}