arthurwolf/Smoothie — pull request #169 by logxen (2013-06-01 19:24:52+00:00)
Title: Switch / Button Merge

Here are a couple examples of switches implemented using the new system:

switch.fan1.enable true # this tells Smoothie to create a new switch named "fan1"
switch.fan1.startup_state false # this sets the initial state of the switch
switch.fan1.input_pin 2.11 # watch for changes on this pin
switch.fan1.input_pin_behavior toggle # valid options are "toggle" and "momentary"
switch.fan1.input_on_command M106 # any command that starts with this exact string turns this switch on
switch.fan1.input_off_command M107 # any command starting with this exact string turns off the switch
switch.fan1.output_pin 2.12! # this pin will follow the state of the switch
#switch.fan1.output_on_command M108 # this command is sent whenever the switch turns on
#switch.fan1.output_off_command M109 # this command is sent whenever the switch turns off

switch.zplus10.enable true
switch.zplus10.input_pin 0.1
switch.zplus10.output_on_command G91 G1 Z10 G90

switch.zminus10.enable true
switch.zplus10.input_pin 0.2
switch.zplus10.output_on_command G91 G1 Z-10 G90