Page 135 - Proyecto
P. 135
void loop()
{
dato=digitalRead(pir);
if(dato==HIGH)
{
analogWrite(rojo1,255);
analogWrite(azul1,0);
analogWrite(verde1,0);
delay(t);
analogWrite(rojo2,0);
analogWrite(azul2,255);
analogWrite(verde2,0);
delay(t);
analogWrite(rojo3,0);
analogWrite(azul3,0);
analogWrite(verde3,255);
delay(t);
analogWrite(rojo1,0);
analogWrite(azul1,236);
analogWrite(verde1,255);
delay(t);
analogWrite(rojo2,204);
analogWrite(azul2,255);
analogWrite(verde2,0);
delay(t);
analogWrite(rojo3,255);
analogWrite(azul3,114);
analogWrite(verde3,0);
delay(t);
}
else
{
analogWrite(rojo1,LOW);
analogWrite(azul1,LOW);
analogWrite(verde1,LOW);
analogWrite(rojo2,LOW);
analogWrite(azul2,LOW);
analogWrite(verde2,LOW);
analogWrite(rojo3,LOW);
analogWrite(azul3,LOW);
analogWrite(verde3,LOW);
}
}
130