diff --git a/Arduino/CanGrow/CanGrow.ino b/Arduino/CanGrow/CanGrow.ino index a874db7..7e8cc63 100644 --- a/Arduino/CanGrow/CanGrow.ino +++ b/Arduino/CanGrow/CanGrow.ino @@ -242,12 +242,9 @@ void setup() { // we do this here because otherwise on inverted // boards like CanGrow PCB v0.6 it would be turned on if(configured == true) { - pinMode(PinLED, OUTPUT); - pinMode(PinPUMP, OUTPUT); - pinMode(PinFAN, OUTPUT); - // set PWM frequency - analogWriteFreq(PWMFrequency); + initOutputs(); } + } diff --git a/Arduino/CanGrow/CanGrow_SysFunctions.h b/Arduino/CanGrow/CanGrow_SysFunctions.h index faf7e90..4c3f5a5 100644 --- a/Arduino/CanGrow/CanGrow_SysFunctions.h +++ b/Arduino/CanGrow/CanGrow_SysFunctions.h @@ -830,3 +830,13 @@ void controlFAN() { setOutput(4, PinFAN2PWM); } +void initOutputs() { + pinMode(PinLED, OUTPUT); + pinMode(PinPUMP, OUTPUT); + pinMode(PinFAN, OUTPUT); + // set PWM frequency + analogWriteFreq(PWMFrequency); + for(byte i = 1; i <= 4; i++) { + setOutput(i, 0); + } +} diff --git a/Arduino/CanGrow/CanGrow_WebFunctions.h b/Arduino/CanGrow/CanGrow_WebFunctions.h index 2e16cbd..e606161 100644 --- a/Arduino/CanGrow/CanGrow_WebFunctions.h +++ b/Arduino/CanGrow/CanGrow_WebFunctions.h @@ -218,26 +218,26 @@ void SysMaintenance() { if( (webserver.hasArg("DimmOn")) ) { MaintenanceMode = true; MaintenanceStarted = millis(); - body += "
Use relais for LED (disable PWM)is set to Yes in 🔆 Grow settings