What's wrong with my code?
-
I have the following definition of variables in config.g:
; AutoFanOff Feature global EnableAutoFanOff = false ; create variable for enable/disable automatic fan shut off global StartTimeAutoFanOff = state.upTime ; create variable for cache the fan start time global DurationAutoFanOff = 240 ; create variable for AutoFanOff duration
Then in daemon.g i have:
; daemon.g ; frequently called routine (0.1 Hz) ; used for checking AutoFanOff Feature ; AutoFanOff (some routines switch the layer fan on for faster cooldown. this code checks if it is time to shut down the fan) if global.EnableAutoFanOff = true ; check if automatic fan shut down is activated if state.upTime > {global.StartTimeAutoFanOff + global.DurationAutoFanOff} ; check if the fan was running for the desired time M106 P0 S0 ; LayerFan off M291 P"AutoFanOff has stopped fan!" R"daemon.g" S0 T5 ; message set global.EnableAutoFanOff = false ; disable automatic fan shut off
When i run this config i get the following error:
Error: in file macro line 6 column 46: meta command: cannot convert operands to same type
Is it possible, that the variable set in config.g (global EnableAutoFanOff = false) is not a boolean?
-
-
@owend
I've found the error in my start.g, where i set the variable to 0.
Sorry for that! -
@cosmowave
That'll do it