From a19c3ca258798e445c8ffdef7518fdf2ff81ad8d Mon Sep 17 00:00:00 2001 From: Hunter Fuller Date: Fri, 19 Aug 2022 20:01:55 -0500 Subject: [PATCH] Initialize the buzzer to high, to stop beeping on boot It seems the pin could be left LOW under some conditions. This will make us always initialize it to HIGH upon setting its pin mode. --- components/ifan/ifan.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/ifan/ifan.cpp b/components/ifan/ifan.cpp index 7baa3374..556b7aaf 100644 --- a/components/ifan/ifan.cpp +++ b/components/ifan/ifan.cpp @@ -18,6 +18,9 @@ void IFan::setup() { pinMode(relay_2, 0x01); pinMode(relay_3, 0x01); + //Initialize buzzer to stop errant beeping due to non-initialized pin + digitalWrite(buzzer, HIGH); + auto restore = this->restore_state_(); if (restore.has_value()) { restore->apply(*this);