Joypad buttons

More
29 Dec 2011 18:40 - 29 Dec 2011 18:43 #16083 by cwebs
Joypad buttons was created by cwebs
Now that you guys helped me get the joypad working I have gone mad with power and have assigned all the buttons but one and now I am traped in the tower. I am trying to get buttons 6 and 8 assigned to run and pause the program. I have the pause button but not having any luck with the run/execute button. I think the problem is what it is really called. I have tried run, start, execute, execute-file. Just don't know what to call it. Here is the code I am trying.

# Buttons to run and pause machine
net programrun input.0.btn-base2 => halui.program.run
net programpause input.0.btn-pinkie => halui.program.pause


Pause works and if I change pause to stop that line works to stop program.
Thanks Carl
Last edit: 29 Dec 2011 18:43 by cwebs.

Please Log in or Create an account to join the conversation.

More
29 Dec 2011 18:51 #16085 by BigJohnT
Replied by BigJohnT on topic Re:Joypad buttons
Carl,

If you look in the HAL Examples section of the forum you will find one button toggles for run/stop, pause/resume, coolant on/off etc.

John

Please Log in or Create an account to join the conversation.

More
29 Dec 2011 19:35 #16090 by cwebs
Replied by cwebs on topic Re:Joypad buttons
Wow that's way over my head still. Can't I just assign a button to run so as to start the program from the joypad for now? Carl

Please Log in or Create an account to join the conversation.

More
29 Dec 2011 23:53 #16096 by BigJohnT
Replied by BigJohnT on topic Re:Joypad buttons
Sure, just be sure and not press it when it is not appropriate to do so or you will get a rather large shock through the joypad... well not really but you will get and error if you try and run when in mdi mode etc.

John

Please Log in or Create an account to join the conversation.

More
30 Dec 2011 00:22 #16100 by cwebs
Replied by cwebs on topic Re:Joypad buttons
Fine, but what is the correct name for the run button? Carl

Please Log in or Create an account to join the conversation.

More
30 Dec 2011 05:23 #16110 by cmorley
Replied by cmorley on topic Re:Joypad buttons
Carl you can always use halmeter to see all available pin names on a running system.
load up the last config that works and open halmeter
you can do this many ways :
- you can add loadusr halmeter to your hal file
- if using axis look under machine menulook for halmeter ( show hal configuration will show pin and signal etc too)
- or open a terminal and type halrun then loadusr halmeter

Do you get an error or does it just not work? remember you must be in auto mode for it to work.

Please Log in or Create an account to join the conversation.

More
30 Dec 2011 12:37 #16117 by BigJohnT
Replied by BigJohnT on topic Re:Joypad buttons
cwebs wrote:

Fine, but what is the correct name for the run button? Carl


I think your asking what pin do you use to run a program??

halui.program.run

linuxcnc.org/docview/html/man/man1/halui.1.html

That is assuming you have halui loaded and if you open up Show HAL Configuration from the Machine menu you can view all the pin names. Just my personal preference to use that instead of halmeter.

John

Please Log in or Create an account to join the conversation.

More
30 Dec 2011 17:06 #16121 by cwebs
Replied by cwebs on topic Re:Joypad buttons
I have tried, halui.program.run, and EMC will start but get error in both manual and mdi stating can't run in manual/mdi.
Also tried halui machine.is-on but I don't think that is the right pin. Learning stuff anyway and that's not easy for an old man. HE HE. Carl

Please Log in or Create an account to join the conversation.

More
30 Dec 2011 17:36 #16123 by BigJohnT
Replied by BigJohnT on topic Re:Joypad buttons
Who you calling old? Have you seen my photo LOL!

Ok, the reason for the lengthy code example for run/pause is you have to be in auto mode to run. That and a few other things the code does for you like prevent a race track condition when changing from run to pause and back.

Thats why you see these two pins among others in the example code...

halui.mode.auto
bit in
# pin for requesting auto mode

halui.mode.is-auto
bit out
# pin for auto mode is on

If you have not read yet the Basic Hal Info chapter I might suggest that now to get a little basic know how on HAL.

linuxcnc.org/docview/2.5/html/hal/basic_hal.html

John

Please Log in or Create an account to join the conversation.

More
30 Dec 2011 22:40 #16142 by cwebs
Replied by cwebs on topic Re:Joypad buttons
John, you remind me of women I have known. Only show enought to keep me intrested. And I did look at your picture. Boy are you old. LOL. Ok I read and reread all you lead me to. I am getting a better understanding . I am a retired machinest and did run TNC machines but didn't have to program. In my mid 60s it doesn't stick well. Thanks, Carl

Please Log in or Create an account to join the conversation.

Time to create page: 0.123 seconds
Powered by Kunena Forum