pyVCP button to control generic digital out

More
5 years 9 months ago #196278 by rodw
Its not often done, but it is possible to maintain a separate pin inside your screen handler that is set by a screen control or by analog or digital input. Its a long time since I've done it but it does work.

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

More
5 years 8 months ago #197926 by oddwick
so for what i am trying to do, that is a bit of overkill. basically i just need to hit button on screen and toggle one of the digital outputs on a 7i96. i would think that it would have been simpler than that. i can do it with the mist and flood, but i have two more that need to do the same thing to...

Now, when you say m code can be any executable, that really peaks my interest for other things. BUT, (there's always a but) you say that one cant pass machine parameters to it unless you remap it. could you elaborate?

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

More
5 years 8 months ago #197950 by rodw
This very old example with help from islander261 is extracted from a python screen handler file for Gmocappy
In this case an analog input is connected to a pin called command-from-file in the handler
Different numeric ranges sent by M67/M68 override the screen controls
So in your case you could connect the screen button to your fan and set it from gcode as well...

Warning: Spoiler!

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

More
5 years 8 months ago #198105 by andypugh
If you just want to link an onscreen button to a physical IO pin it is just a case of making the control in a PyVCP panel and (in HAL) connecting the pyvcp pin to the io pin.

It would be as simple as

net this-pin pyvcp.button -> hm2_7i96.0.gpio.000.out

Or similar.

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

More
5 years 8 months ago #198115 by oddwick
ahhhh so simple, thats what i'm talking about! can i still use a toggle with it?

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

More
5 years 8 months ago #198131 by andypugh
Yes, you can use any PyVCP control with a bit output.

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

Time to create page: 0.252 seconds
Powered by Kunena Forum