Sorry for my bad English.
I Have a simple code with 1 function.
The function is:
void blinking((int time, int color){
// colore = 1 == Red
// colore = 2 == Yellow
// colore = 3 == Red and Yellow
pinMode(RED, OUTPUT);
pinMode(YELLOW, OUTPUT);
for (int i = 0; i <= quanto; i++) {
switch (colore) {
case 1:
digitalWrite(RED, HIGH);
delay(1000);
digitalWrite(RED, LOW);
break;
case 2:
digitalWrite(YELLOW, HIGH);
delay(1000);
digitalWrite(YELLOW, LOW);
break;
case 3:
digitalWrite(RED, HIGH);
digitalWrite(YELLOW, HIGH);
delay(1000);
digitalWrite(RED, LOW);
digitalWrite(YELLOW, LOW);
break;
default:
break;
// if nothing else matches, do the default
// default is optional
}
delay(1000);
}
This function works without problems until I put in my code these lines and after I recall my function "blinking", it doesn't work, but the call before this code it works
while (FLAG == 0){
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
} else {
FLAG=1;
}
}
Leds don't blink, why? can you help me?
