Fixed Fan to use correct library and range

This commit is contained in:
Tony 2014-03-03 20:32:37 +00:00
parent 799e69dca2
commit 0da2319c67

View file

@ -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)