Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. plasma.hal
  2. # For Joypad, the rest are in postgui.hal
  3. loadusr hal_input -W -KRAL Dual
  4.  
  5. postgui.hal
  6. # The Joypad connections
  7. loadrt mux4 count=1
  8. addf mux4.0 servo-thread
  9. loadrt or2 count=2
  10. addf or2.0 servo-thread
  11. addf or2.1 servo-thread
  12. loadrt sum2 count=2
  13. addf sum2.0 servo-thread
  14. addf sum2.1 servo-thread
  15.  
  16. # set the jog speed for the joypad
  17. setp mux4.0.in0 0
  18. setp mux4.0.in1 25
  19. setp mux4.0.in2 100
  20. setp mux4.0.in3 200
  21.  
  22. # the following does the magic of setting the jog speeds
  23. net remote-speed-slow or2.0.in0 input.0.btn-trigger
  24. net remote-speed-medium or2.1.in0 input.0.btn-thumb
  25. net remote-speed-fast or2.0.in1 or2.1.in1 input.0.btn-thumb2
  26.  
  27. net joy-speed-1 mux4.0.sel0 <= or2.0.out
  28. net joy-speed-2 mux4.0.sel1 <= or2.1.out
  29.  
  30. net remote-jog-speed halui.jog-speed <= mux4.0.out
  31.  
  32. net joy-x-jog halui.jog.0.analog <= input.0.abs-x-position
  33.  
  34. # reverse the analog so the Y axis will go in the expected directionaddf mux4.0 servo-thread
  35. setp sum2.0.gain0 -1
  36. net reverse-y sum2.0.in0 <= input.0.abs-y-position
  37. net joy-y-jog halui.jog.1.analog <= sum2.0.out
  38.  
  39. # reverse the analog so the Z axis will go in the expected direction
  40. setp sum2.1.gain0 -1
  41. net reverse-z sum2.1.in0 <= input.0.abs-rz-position
  42. net joy-z-jog halui.jog.2.analog <= sum2.1.out
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement