Hello all,
I am currently creating a bedroom temperature alarm. I have created a section of code I was just wondering is there anyway to neaten the code or have I made it to wordy.
Basic Program Function.
When bedroom temperature is to high or low this alert system will trigger causing a flashing display on an LCD and active a passive buzzer to sound.
Everything works as intended, just looking for some advice.
// Alarm code to be activated when room temp is to High or Low.
lcd1.setCursor(4, 0);
lcd1.print("ALERT! ");
lcd1.write(1);
noTone(PassiveBuzzer1);
delay(1000);
lcd1.clear();
lcd1.setCursor(4, 0);
lcd1.print("ALERT! ");
lcd1.write(2);
tone(PassiveBuzzer1, 200);
delay(1000);
lcd1.clear();
Order a GPS module. It will tell you your location.
Seriously though, you didn't tell us what you think is wrong with your test sketch. What do you want? Better formatting? Better use of system functions? More efficiency? What?
Some minutae, I would suggest giving the custom characters a name.
We're constantly telling people to write test code before writing huge projects. It's a good thing they did this.
Regards the request, I strongly suggest aiming for clarity rather than mere conciseness. That will actually make it more "wordy". But it will be easier to read and maintain.