How can i get the initial value after increment or dircrement. ![]()
Not sure exactly what you mean, but sounds like you should save the value into another variable called say oldValue before you change it?
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#include <Servo.h>
#define I2C_ADDRÂ Â 0x3F
LiquidCrystal_I2CÂ lcd(I2C_ADDR,2, 1, 0, 4, 5, 6, 7);
unsigned long prevMillis;
int count = 10;
int minute = 11;
int counter = 0; // initial amount of presses
// ONE TIME RUN
void setup() {
 lcd.begin (16,4);  // Inicializar el display con 16 caraceres 2 lineas
 lcd.setBacklightPin(3,POSITIVE);
 lcd.setBacklight(HIGH);
 // Print a message to the LCD.
 lcd.setCursor(2,2);
 lcd.print(":");
 prevMillis = millis(); // get the time at the start
}
// REPEATED RUN
void loop() {
 Serial.begin(9600);
  countdown();
}
void countdown() {
  delay(150);
  unsigned long curMillis = millis();
 Â
 if(curMillis - prevMillis >= 1000){
  count -= 1;
 Â
  lcd.setCursor(3,2);
  lcd.print(count);
 Â
  prevMillis += 1000;
 Â
 if (count<10){
  lcd.setCursor(3,2);
  lcd.print("0");
  lcd.setCursor(4,2);
  lcd.print(count);
  }
 Â
  if(minute<10){
  lcd.setCursor(1,2);
  lcd.print(minute);
  lcd.setCursor(0,2);
  lcd.print("0");
  }
  if(minute>9){
  lcd.setCursor(0,2);
  lcd.print(minute);
  }
  }
 Â
   if(count == 0){
    minute -= 1;
    count = 10;
    }
  Â
}
what i want is after variable "minute" reaches cero its initial value to be 11 again.
  if(minute == 0){
   Â
    minute =[i] initial value[/i];
    }
Can't you just say....
if(minute == 0)
{
  minute =11;
 }
?
Yes, but the thing is that "minute" will be any number. I can adjust the number with a push button increasing or decreasing. But thank you for you answer i found out that i can create two variables with the same value. By the way, can you rate my english? xD