Dear, I'm a new with arduino.
I'm developping a sketch that should manage an air fun at home in a specific condition.
So, the sketch work well on Arduino UNO. i tested it for many days (breadbord).
Few days ago i got an ARDUINO MICRO. I did modify just few unimportant things (name of some variables and some string text).
What happen now?
In the sketch are present many if - do - while.
At certain moment i ask to check if a BT_Setting (button) is pushed. in this case do what inside if.... But the sketch execute what inside "if" in any case.
I checked for mistake like formatting, wrong variable names atc, but all is fine
The problematic if is:
BT_Setting = digitalRead(Set_Bt);
if (BT_Setting == LOW)
{
XXXXXX
XXXXXX
XXXXX
}
This (belove) is the line before and after and attached you can find the whole sketch.
............................
////////////////////////////// AUTOMODE LOW ////////////////////////
if (autoMode == LOW) // mode=low --> Relay is OFF
{
Rel_OFF (); //need to shiwtch relay off when return from Smoke-mode
// Enable Manual START if request by operator
//////////////////////////////////////////////////////////
BT_Setting = digitalRead(Set_Bt);
if(BT_Setting == LOW)
{
lcd.init(); // POINT of ERROR
lcd.setCursor(1, 0);
lcd.print("BT set ");
lcd.print(BT_Setting);
delay (5000);
Delay_time (); // Check for manual ON loop
Rel_OFF (); //call subtoutine OFF
autoMode = LOW; //set to OFF
Time_ref = millis();
Millis_Min ();
lcd.init(); // POINT of ERROR
lcd.setCursor(1, 0);
lcd.print("ERRORE ");
}
Toff_Last = ((((Toff + Time_ref) - (millis())) / TM_conv) + 1);
Serial.println((String)"RELAY OFF, it goes ON into " + Toff_Last + " min");
lcd.init(); // initialize the lcd
lcd.setCursor(3, 0);
lcd.print("RELAY OFF:");
lcd.setCursor(0, 1);
lcd.print("ON into ");
lcd.print(Toff_Last);
lcd.print(" min");
delay (T_step);
..................
As i sayd before in the sketch are present many "IF" and just 3, related to this BT_Setting give me haedacke.
I really can't find the problem, please help!!!!!
Thanks for your help
ARD1_Aria_V7_LAST.ino (18.4 KB)