Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- plasma.hal
- # For Joypad, the rest are in postgui.hal
- loadusr hal_input -W -KRAL Dual
- postgui.hal
- # The Joypad connections
- loadrt mux4 count=1
- addf mux4.0 servo-thread
- loadrt or2 count=2
- addf or2.0 servo-thread
- addf or2.1 servo-thread
- loadrt sum2 count=2
- addf sum2.0 servo-thread
- addf sum2.1 servo-thread
- # set the jog speed for the joypad
- setp mux4.0.in0 0
- setp mux4.0.in1 25
- setp mux4.0.in2 100
- setp mux4.0.in3 200
- # the following does the magic of setting the jog speeds
- net remote-speed-slow or2.0.in0 input.0.btn-trigger
- net remote-speed-medium or2.1.in0 input.0.btn-thumb
- net remote-speed-fast or2.0.in1 or2.1.in1 input.0.btn-thumb2
- net joy-speed-1 mux4.0.sel0 <= or2.0.out
- net joy-speed-2 mux4.0.sel1 <= or2.1.out
- net remote-jog-speed halui.jog-speed <= mux4.0.out
- net joy-x-jog halui.jog.0.analog <= input.0.abs-x-position
- # reverse the analog so the Y axis will go in the expected directionaddf mux4.0 servo-thread
- setp sum2.0.gain0 -1
- net reverse-y sum2.0.in0 <= input.0.abs-y-position
- net joy-y-jog halui.jog.1.analog <= sum2.0.out
- # reverse the analog so the Z axis will go in the expected direction
- setp sum2.1.gain0 -1
- net reverse-z sum2.1.in0 <= input.0.abs-rz-position
- net joy-z-jog halui.jog.2.analog <= sum2.1.out
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement