in your code that you put me above definito state of alarm, as follows:
<code>int Alarm( char * message)
{
// write time (millis()) + message to logfile ?
stergeLCD();
nivelIluminare(25);
digitalWrite(LED_1, LOW);
digitalWrite(LED_2, HIGH);
mutaCursorLaPozitia(0, 0);
SerialLCD.print(message);
cursorInvizibil();
delay(500);
stergeLCD();
digitalWrite(LED_1, HIGH);
digitalWrite(LED_2, LOW);
delay(500);
}
</code>
I notice that you left here and delay, but I found that the alarm condition
may be to you in the following code in this site:
http://www.arduino.cc/en/Tutorial/BlinkWithoutDelayand my code would look like this:
<code>
void stare_alarma()
{
unsigned long currentMillis = millis();
if(currentMillis - previousMillis > interval) {
// save the last time you blinked the LED
previousMillis = currentMillis;
// if the LED is off turn it on and vice-versa:
if ((Stare_LED_1 == HIGH)&&(Stare_LED_2 == LOW))
{
nivelIluminare(25); //brightness 25
mutaCursorLaPozitia(0, 0); // row one of the LCD
SerialLCD.print("ALARMA! "); // My message which I want
//to appear on line 1 of LCD
mutaCursorLaPozitia(1, 0); // row 2 of the LCD
SerialLCD.print(" MISCARE!"); // My message which I want
//to appear on line 2 of LCD
cursorInvizibil(); //on screen is not displayed any type of cursor
// (remains only text)
Stare_LED_1 = LOW;
Stare_LED_2 = HIGH;
}
else {
stergeLCD(); //delete the entire contents displayed on the LCD screen
Stare_LED_1 = HIGH;
Stare_LED_2 = LOW;
}
// set the LED with the ledState of the variable:
digitalWrite(LED_2, Stare_LED_1);
digitalWrite(LED_1, Stare_LED_2);
}
}
</code>
so now I showed how I used the code from the site which I put above. now I do not
use any of a delay (). in this state if I do I still program to turn to while ()
and inside the while () I would not use delay () or another while () like I used
at first to the contrary would create code and how I You have shown you, that way
I could get out of the state of alarm by pressing the three buttons code?