I'm new in programming with the Arduino and I hope you can help.
I have a Arduino Mega 2560 + Ethernet Shield, connected with an DS18S20 temperature sensor, an LCD-Display and an piezo buzzer for my alarm.
Displaying the temperature (positive and negative values) on the LCD-Display works, also get the time by an ntp-server.
I also get a alarm tone with the piezo buzzer if the temperature is over or under a value I set before, but only if I have positive values for temperature in my 'if-instruction'.
My problem is, If I set negative temperature values in my 'if-instruction' to get an alarm it doesn't work!
Hi, Im new to arduino myself but I do have a similar setup to you. You could try putting your temperature values (ie. -10,-30) into an array and try it that way. something like this;
I was taught to not use numbers in my code and to basically define everything at the beginning and create arrays to help simplify things. Using arrays also helps you find change those values in 1 place rather than several.