firmware wip - adjust PWM frequency. todo: add some decoupling capacitors to pcb

This commit is contained in:
Marcus 2024-06-05 14:02:15 +02:00
parent 81680a335a
commit 0d0cd8d7b6

View file

@ -77,12 +77,8 @@ void setup() {
// PINsoilmoisture is always HIGH and gets LOW in moment of waterlevel measurement
digitalWrite(PINsoilmoisture, LOW);
// set PWM frequency lower to avoid annoying noises
// in combination with 47uF at fan output, 220Hz is kinda sweetspot for a fan
// but i guess putting just a cap in parallel for voltage regulation isnt a good idea
// low pass filter or buck converter would be better
// 220Hz is note A3 btw.
analogWriteFreq(220);
// set PWM frequency to 2.2KHz
analogWriteFreq(2200);
// Start EEPROM
EEPROM.begin(512);
@ -229,7 +225,7 @@ void loop() {
if(MaintenanceMode == true) {
if((currentRuntime - MaintenanceStarted <= MaintenanceDuration * 1000 ) && (UseLEDrelais == false)) {
// in case of being in Maintenance Mode , dimm the grow light when not a relais is used
setOutput(1, 20);
setOutput(1, 15);
} else {
MaintenanceMode = false;
}