So for my little project I created a thermostat using an active buzzer, LM35 temp sensor, and 1602 lcd liquid crystal screen. Everything is going smoothly except the active buzzer portion. I want the buzzer to activate when it reaches 75 degrees F and to stop when it goes below but it wants to keep buzzing forever?
Sorry if code is sloppy. I'm still a beginner.
oh ok. I thought that since the code is constantly looping it turn off on its own. So it would work if I put in an else if statement saying that the buzzer is to turn off if < 75???
fettersp:
oh ok. I thought that since the code is constantly looping it turn off on its own.
Remember that code only does what you tell it to do. Take also the advice offered by demkat1. Your entire if statement, after removing the duplicate prints, can be reduced to