summaryrefslogtreecommitdiff
path: root/Sprinter/Sprinter.pde
diff options
context:
space:
mode:
authorcondac <burns.nu@gmail.com>2011-09-03 19:41:16 +0300
committercondac <burns.nu@gmail.com>2011-09-03 19:41:16 +0300
commit731907b880e57d209d26646ef7efb55d3ec04643 (patch)
treeb91b18f20dd1a45a9205852b7c910379b50cd4ee /Sprinter/Sprinter.pde
parent6308360ef8738c2af78c6ee5e206da46425b79f1 (diff)
Fix so the FAN works, added fan pin as output and fixed fan off case statement
Diffstat (limited to 'Sprinter/Sprinter.pde')
-rw-r--r--Sprinter/Sprinter.pde12
1 files changed, 10 insertions, 2 deletions
diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde
index dde302c..364393e 100644
--- a/Sprinter/Sprinter.pde
+++ b/Sprinter/Sprinter.pde
@@ -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)