FranzAT / libreelec_PWM_fan

Cooling Raspberry Pi, which is running LibreELEC, by controlling the fan speed of a 5V fan.
MIT License
1 stars 0 forks source link

Change File vor PC 4 Pin Fan #2

Open DukeX21 opened 2 years ago

DukeX21 commented 2 years ago

Hello, what should I change in the file PWM_fan.PY? When I use a PC fan and the control signal has to work the other way around. 100% PWM is 0 speed and 0% PWM would be max speed. An attempt to change this was unfortunately unsuccessful.

FranzAT commented 2 years ago

Hi. I'm myself absolute beginner. Not sure if this would work, but you can try following: GPIO.setup(FAN_PIN, GPIO.OUT, initial=GPIO.HIGH) instead of GPIO.setup(FAN_PIN, GPIO.OUT, initial=GPIO.LOW) and fan.ChangeDutyCycle(100-fanSpeed) instead of fan.ChangeDutyCycle(fanSpeed). Or second option: invert the speedSteps = [100, 75, 40, 60, 50, 40, 35] # [%] and rething the logic for

if (fanSpeed != fanSpeedOld and (fanSpeed >= FAN_MIN or fanSpeed == 0)):
                    fan.ChangeDutyCycle(fanSpeed)