Hello All,
I've put some gcode buttons on my 2.4, Switchwire and 0.2 but the macro to toggle lights with buttons that I've found online all use output_pin to activate gcode like:
My problem is that my case ligths are all neopixels and do not work with output_pin macros. Does anybody have a toggle macro to neopixels lights or could help to adapt this macros as i'm not any good at writing macros.
I Can Make On and OFF with
But I don't know how to toggle it
Best Regards
I've put some gcode buttons on my 2.4, Switchwire and 0.2 but the macro to toggle lights with buttons that I've found online all use output_pin to activate gcode like:
Code:
#####################################################################
# Caselight pin Definition
#####################################################################
## Caselight - XYE board, HB Connector
[output_pin caselight]
pin: P2.5
pwm: true
hardware_pwm: true
shutdown_value: 0
cycle_time: 0.0001
#####################################################################
# Macros
#####################################################################
[gcode_macro _CASELIGHT_ON]
description: Helper: Light on
gcode:
SET_PIN PIN=caselight VALUE={printer['gcode_macro _USER_VARIABLE'].peripheral.caselight.on_val}
{action_respond_info("Caselight on")}
[gcode_macro _CASELIGHT_OFF]
description: Helper: Light off
gcode:
SET_PIN PIN=caselight VALUE=0.0
{action_respond_info("Caselight off")}
[gcode_macro CASELIGHT]
description: Toggle light
gcode: {% if printer['output_pin caselight'].value == 0 %} _CASELIGHT_ON {% else %} _CASELIGHT_OFF {% endif %}
My problem is that my case ligths are all neopixels and do not work with output_pin macros. Does anybody have a toggle macro to neopixels lights or could help to adapt this macros as i'm not any good at writing macros.
I Can Make On and OFF with
Code:
[gcode_macro _CASELIGHT_ON]
description: Helper: Light on
gcode:
# SET_PIN PIN=caselight VALUE={printer['gcode_macro _USER_VARIABLE'].peripheral.caselight.on_val}
SET_LED LED="caselight" RED=1 GREEN=1 BLUE=1 SYNC=0 TRANSMIT=1 #VALUE={printer['gcode_macro _USER_VARIABLE'].peripheral.caselight.on_val}
{action_respond_info("Caselight on")}
[gcode_macro _CASELIGHT_OFF]
description: Helper: Light off
gcode:
# SET_PIN PIN=caselight VALUE=0.0
SET_LED LED="caselight" RED=0 GREEN=0 BLUE=0 SYNC=0 TRANSMIT=1
{action_respond_info("Caselight off")}
But I don't know how to toggle it
Best Regards
Last edited: