From 0da2319c6762a4b756ca2607e67e952fd36d731e Mon Sep 17 00:00:00 2001 From: Tony Date: Mon, 3 Mar 2014 20:32:37 +0000 Subject: [PATCH] Fixed Fan to use correct library and range --- Platform.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Platform.h b/Platform.h index a465873..fc2193e 100644 --- a/Platform.h +++ b/Platform.h @@ -551,7 +551,7 @@ class Platform uint16_t zProbeReadings[NumZProbeReadingsAveraged]; int zProbeADValue; float zProbeStopHeight; - bool zProbeEnable; + // AXES void InitZProbe(); @@ -936,11 +936,16 @@ inline float Platform::DMix(int8_t heater) const return dMix[heater]; } +//Changed to be compatible with existing gcode norms +// M106 S0 = fully off M106 S255 = fully on inline void Platform::CoolingFan(float speed) { + //byte p = (byte)(255.0*fmin(1.0, fmax(0.0, speed))); //this reverts to 0= off, 1 = on if uncommented + byte p = (byte)speed; + p = 255 - p; //duet v0.6 if(coolingFanPin < 0) return; - analogWrite(coolingFanPin, (uint8_t)(speed*255.0)); + analogWriteNonDue(coolingFanPin, p); } //inline void Platform::SetHeatOn(int8_t ho)