how to hook up a second signal to
hooked up a xbox one controller
created a subroutine (for crosslaser offset) move torch.
hooked up the custom button in plasmac extra to the subroutine and a button from the xbox controller
hooked up buttons from xbox controller to mdi-commands LaserON, LaserOFF
now comes the difficult part for me, I would like to use the hat to move the x and y axis
plasmathc.hal:net jog-x-pos halui.axis.x.plus
plasmathc.hal:net jog-x-neg halui.axis.x.minus
plasmathc.hal:net jog-y-pos halui.axis.y.plus
plasmathc.hal:net jog-y-neg halui.axis.y.minus
plasmathc.hal:net jog-z-pos halui.axis.z.plus
plasmathc.hal:net jog-z-neg halui.axis.z.minus
my plasmathc.hal part for the controller looks like:
#setup xbox controller
loadusr -W hal_input -KRAL Microsoft
#for midi and subroutine part in postgui.hal
net xbox-a <= input.0.btn-a
net xbox-b <= input.0.btn-b
net xbox-x <= input.0.btn-x
net xbox-y <= input.0.btn-y
#jog with hat
net xbox-hat-r halui.jog-x-pos <= input.0.abs-hat0x-is-pos
net xbox-hat-l halui.axis.x.minus <= input.0.abs-hat0x-is-neg
net xbox-hat-up halui.axis.y.plus <= input.0.abs-hat0y-is-neg
net xbox-hat-down halui.axis.y.minus <= input.0.abs-hat0y-is-pos
the above fails of course claiming signal is already hooke on. do I need an OR in order to hook up two signals? where do I put those in?
and i would like to use two buttons to change the jog-speed to low and fast again. no clue how to get the values in.
thank you very much for your help again and again and.....
Please Log in or Create an account to join the conversation.
which would mean
remove net jog-x-pos from the main hal file ?
and make a postgui with
loadrt or2
addf or2.0 servo-thread
net xbox-hat-r or2.0.in0 <=input.0.abs-hat0x-is-pos
net systemXplus or2.0.in1 <= halui.axis.x.plus
net hal.jog-x-pos <= or2.0.out
??this is very difficult... for me
Please Log in or Create an account to join the conversation.
You can use unlinkp to unlink a signal
eg
unlinkp jog-x-pos
That means you don't break anything.
do this in your plasmac connections hal file or perhaps in a new hal file altogether which needs to be loaded in your ini file. the same way the others are now.
If you need to unlink a screen variable, you need to uses a postgui file and it has a different command to load it in the in infile. See the ini file docs. I had to read up on that yesterday
Please Log in or Create an account to join the conversation.
Thank you Rodw!
Please Log in or Create an account to join the conversation.
Can I use in a subroutine
setp halui.jog-speed 10 ??? to pass on parameters?
I think I need to use
halui.jog.<n>.plus instead of hal.jog-x-pos (only an example) so this is free and not hooked up?
Please Log in or Create an account to join the conversation.
There are several ways to configure pins in hal and some of them are confusing. But my rule is to think of a signal as being a piece of wire. You can't connect a pin twice as it can only accept one wire. But you can connect the same wire to many pins
so I do this
net mysig <= mycomp.0.out
net mysig => mycomp.1.in
net mysig => spindle.0.on
So the => and <= are optional but make it more readable
So the first line creates a signal name called mysig.
So the next two lines connect that signal (or wire) to two other components.
I think this is much easier to read and maintain.
Some people fold the first two lines in to one as shown below but I never do that. It just makes things harder.
net mysig mycomp.1.in <= mycomp.0.out
THe last couple of days, I've been cursing PhillC as I hack fairly deeply into Plasmac for not doing it the way I suggest. For the most part, I can use unlinkp and leave the system hal files untouched which will make my custom work easier to maintain
But there is one pin I could not do that for some reason so I had to edit one of the screen handling
Please Log in or Create an account to join the conversation.
used qjoypad to setup the controller so I didn't need to unlink and break etc.
but brought me further in understanding mux4 and/or as well.
I intended to set the jog speed by extra button and button of the xbox controller
I thought if that could be done by subroutine it would be the easiest since they can be called......
second I found out that the move of axis using the controller is as well same situation to break add or/and and
at the end I find that not worth breaking a working system.
since they are all linked it is only possible with unlink and / or the mux and doing own hal as rodw suggested.
at least I created a own xbox.hal and added the pins to run the subroutinge G code for crosslaser on / off and the offset move.
thanks RODW for explaining again
net
thank you
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Some people fold the first two lines in to one as shown below but I never do that. It just makes things harder.
net mysig mycomp.1.in <= mycomp.0.out
I can only strong agree....
Please Log in or Create an account to join the conversation.
if the USB joypad gets EMI it will shut down the System but not the movementof the interpreter
if you are lucky the part will be finished without the Perifery of the system Mouse screen Keyboard Joypad doing anything
THIS CAN Happen
the Postgui is separeted to the base Hal system
i added my xbox joypad hal file
Attachments:
Please Log in or Create an account to join the conversation.