mikey63 / XO-Core-XY-Printer

Compact Enclosed Core XY 3D printer with design elements from multiple open-source printers
GNU General Public License v3.0
32 stars 5 forks source link

[Suggestion] Control your RPI fan hat with macros #2

Open thiagolocatelli opened 1 year ago

thiagolocatelli commented 1 year ago

You can control the fan speed on your fan hat by using macros and I2C. Just install the gcode shell command klipper plugin (manually or via Kiuah), enable I2C via raspi-config and then use there

[gcode_shell_command rpi_fan_50]
command: i2cset -y 1 0x01a 0x32
timeout: 30.
verbose: True

[gcode_shell_command rpi_fan_25]
command: i2cset -y 1 0x01a 0x19
timeout: 30.
verbose: True   

[gcode_macro rpi_fan_50]
gcode:
    RUN_SHELL_COMMAND CMD=rpi_fan_50

[gcode_macro rpi_fan_25]
gcode:
    RUN_SHELL_COMMAND CMD=rpi_fan_25 
mikey63 commented 1 year ago

Awesome, Thank you! I'll give this a shot.