Fix so the FAN works, added fan pin as output and fixed fan off case statement

This commit is contained in:
condac 2011-09-03 19:41:16 +03:00
parent 6308360ef8
commit 731907b880

View file

@ -293,6 +293,11 @@ void setup()
SET_OUTPUT(HEATER_1_PIN);
#endif
//Initialize Fan Pin
#if (FAN_PIN > -1)
SET_OUTPUT(FAN_PIN);
#endif
//Initialize Step Pins
#if (X_STEP_PIN > -1)
SET_OUTPUT(X_STEP_PIN);
@ -807,9 +812,12 @@ inline void process_commands()
WRITE(FAN_PIN, HIGH);
break;
case 107: //M107 Fan Off
analogWrite(FAN_PIN, 0);
if (code_seen('S')){
analogWrite(FAN_PIN, 0);
}
else {
WRITE(FAN_PIN, LOW);
}
break;
#endif
#if (PS_ON_PIN > -1)