rendered paste body# load the userspace driver for inputdevice
loadusr -W hal_input 3
#load 4 comparators for comparing the pad position to generate bit signals
loadrt comp count=4
addf comp.0 servo-thread
addf comp.1 servo-thread
addf comp.2 servo-thread
addf comp.3 servo-thread
newsig rawx float
linksp rawx input.0.abs-hat0x-position
linksp rawx comp.0.in0
setp comp.0.in1 -0.1
linksp rawx comp.1.in1
setp comp.1.in0 0.1
newsig jog.x.plus bit
newsig jog.x.minus bit
linksp jog.x.plus comp.1.out
linksp jog.x.minus comp.0.out
linksp jog.x.plus halui.jog.0.plus
linksp jog.x.minus halui.jog.0.minus
newsig rawy float
linksp rawy input.0.abs-hat0y-position
linksp rawy comp.2.in0
setp comp.2.in1 -0.1
linksp rawy comp.3.in1
setp comp.3.in0 0.1
newsig jog.y.plus bit
newsig jog.y.minus bit
linksp jog.y.plus comp.2.out
linksp jog.y.minus comp.3.out
linksp jog.y.plus halui.jog.1.plus
linksp jog.y.minus halui.jog.1.minus
#set the jogging speed
setp halui.jog-speed 100
#connect machine on and off
newsig machine-on bit
linksp machine-on input.0.btn-base
linksp machine-on halui.machine.on
newsig machine-off bit
linksp machine-off input.0.btn-top2
linksp machine-off halui.machine.off
#connect estop and estop reset
newsig estop bit
linksp estop input.0.btn-pinkie
linksp estop halui.estop.activate
newsig estop-reset bit
linksp estop-reset input.0.btn-base2
linksp estop-reset halui.estop.reset
#connect spindle on and off
net spindle-on input.0.btn-trigger halui.spindle.start
net spindle-off input.0.btn-thumb halui.spindle.stop