Skip to content

Commit

Permalink
Fix value passed to SPEED in air-filteration.md macro. (#3133)
Browse files Browse the repository at this point in the history
Fix value passed to SPEED

The SPEED parameter of SET_FAN_SPEED needs to be between 0.0  and 1.0. Since the S param, which is between 0 and 255, was being passed as is to SPEED, it effectively resulted in the target fan running at 100% if any value > 0 was passed to M106.
  • Loading branch information
IntenseWiggling authored Dec 15, 2023
1 parent 3ca290d commit de0f5c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/air-filtration.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ hardware_pwm: false
[gcode_macro M106]
gcode:
{% set fan = 'fan' + (params.P|int if params.P is defined else 0)|string %}
{% set speed = (params.S|int if params.S is defined else 255) %}
{% set speed = (params.S|float / 255 if params.S is defined else 1.0) %}
SET_FAN_SPEED FAN={fan} SPEED={speed}
```

0 comments on commit de0f5c9

Please sign in to comment.