I'm having a few issues with If/Else statements with my Arduino and am hoping that you guys (and girls) can help.
I am building an aquarium monitoring system (comprising of temperature, level and filter flow rate information displayed on an LCD display and text messaging should any parameter go outside of specification) and my issue is this:
I have an If/Else statement to evaluate a digital input from a level sensor, the idea is that if the input is high (i.e. the tank level is within spec.) then the LCD backlight is switched off and 'Level:OK' is displayed. In the event that the input goes low (i.e. the tank level has dropped and is now out of spec.) the backlight is switched on, "Level:Low" is displayed and the system sends a text message.
I'm not concerned about the text messaging part yet (starting with the basics!) but am struggling to specify two actions in an If statement (code follows):
if (digitalRead(buttonPin) == LOW)
lcd.print is currently commented out however the digitalWrite portion works okay; if I comment out the digitalWrite the lcd.print portion works okay - the plan is to have both the lcd.print & digitalWrite actions take place for each condition.
Hopefully that all makes sense and I would welcome any tips or advice offered as this is now driving me crazy!