Hello Guest it is March 28, 2024, 08:23:13 AM

Author Topic: Need some minor LUA adjustments...  (Read 6114 times)

0 Members and 1 Guest are viewing this topic.

Offline CRS

*
  •  61 61
    • View Profile
Re: Need some minor LUA adjustments...
« Reply #20 on: June 01, 2017, 09:39:04 PM »
Hi again Soruud, so which buttons are you thinking of?  I mean for which functions?

I re read the whole thread by Bob69 (Bob Mill) which was back in October 2016.  It was about multiple inputs in a Lua script.  I am sure you must have come across it, but just in case here it is

http://www.machsupport.com/forum/index.php/topic,33402.0.html

He spends a lot of time on the whole Jogging thing.  So I send a personal message to him asking if he has it sorted yet.  He was almost there back then.  So hopefully...

I re read and the rc definitely stands for Return Code, so I assume that is what Chaoticone was talking about with error checking.  Now to figure that out as well.

Anyway, I'll let you know if Bob comes back with some info.

Craig.
Re: Need some minor LUA adjustments...
« Reply #21 on: June 02, 2017, 12:30:54 AM »
That is true. It dont mather what type of I/O board we use.. The way to do it is the same.

Have a nice day at school. I my self are going for a weekend with Hardcore OffRoad ;)

Pic attached :)

Offline CRS

*
  •  61 61
    • View Profile
Re: Need some minor LUA adjustments...
« Reply #22 on: June 02, 2017, 01:59:09 AM »
I wasn't going to school for the day, just drop off my little girl. Believe it or not, I do in fact work....occasionally.

That is a fun buggy you are going to punish on the weekend.  Have fun, I'm sure you will.

I heard back from Bob69, sadly he has never got the whole jogging thing worked out.  That's a shame.  He seemed to have a better grasp of how to make the scripts work than I ever have, so I'm not feeling confident...

Still, if I/you stick with it long enough the answer will happen.  Wouldn't it be nice if there were just a user interface and we ticked the boxed for what we wanted and it all just happened?  Maybe with Mach 97 that will happen.

Have fun OffRoad.

Craig.

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Need some minor LUA adjustments...
« Reply #23 on: June 02, 2017, 09:15:15 AM »
Hi Chaoticone, thanks for the encouragement, it was of course your fault that I discovered the simplicity of using the standard switch as momentary.  Lesson there was, don’t assume without trying.

Other lesson, be more precise when asking questions.  I led DazTheGas off on a tangent looking for the switch to have a time delay, because that is what I asked for.  He is a good man hey.  Still I ended up using his idea in the Macros for M3, M4 and M5.  So all good.  And learned about the wx.timer along the way.

Now there you go mentioning something that I now need to know about.   Kind of like saying to a child, “did you know about the free ice cream?”  As if they are going to let that go.

Error checking??  Has that something to do with the rc.____  I see it a lot?  I worked out the “rc” must be Return Code, but return from what?

Thanks  Chaoticone, off to hit my head against another brick wall.

Craig.


Yup, rc = return code. It is used for Machs built in error checking and returned from the core (which is the wizard behind the curtain, manages all things Mach) the best I understand. I think all of the api calls have the various possibilities for each call listed in the API help file. The more you learn/understand about Machs lua the better the help file is. It really is good.

Here is a link you might find helpful.
http://www.machsupport.com/forum/index.php/topic,32263.msg224557.html#msg224557

And an attachment.
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Need some minor LUA adjustments...
« Reply #24 on: June 02, 2017, 09:33:36 AM »
Hi. I was allso wondring about the RC word... What does it mean?
And how exactly do I make a external button to set an output without going back to previous state when using momentary buttons? I tought I knew, but still dont.
When a momentary button are pressed it changes state, but it does it again on release... This is probably a dumb question...
I tought I got control of my buttons until yesterday whan I found out that things dont work...

Things work just fine as screen buttons, but not as pokeys unput buttons...

Daz... Please. You know all about this, dont you ???

An tutorial video for dummies during setup of Pokeys buttons would be just awesome :))



Lots of ways you can do buttons, inputs, etc..

Regular button ..... is a momentary. It goes down when clicked and back up when released. Toggle: one press or state change sets the state of something, another press sets another state, another press........ etc.

First find out what state your in then do what ever you want on the next press/state change. For an on screen button do it in the buttons clicked script, for an input button use the sig lib (signal script) in the screen load script. If you want an on screen button and an input button to do the same thing create a function and call it from the on screen button and sig lib. If want a custom m code to do the same thing roll that function into a module and call if from onscreen buttons, input buttons and/or m codes.

Toggle Button....... is a two state button. It has an up and down state that are maintained until the next click. The up state script and properties are what you want the button to do, look like and say when in the up state. Same for down.

You can do any of teh above with dwell by using a timer as Daz has already done such a good job showing.


;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!

Offline CRS

*
  •  61 61
    • View Profile
Re: Need some minor LUA adjustments...
« Reply #25 on: June 08, 2017, 05:58:08 AM »
Hi Soruud, how was the big boys weekend away?  I assume you must be back.

Have you seen one of the latest posts by Bob69.  I have been involved with him as he works out the same thing you are interested in with the external Jogging

I think he has it.  Go here and have a look http://www.machsupport.com/forum/index.php/topic,35072.0.html

I have it edited to suit my needs, but haven't tried it yet.

Craig
Re: Need some minor LUA adjustments...
« Reply #26 on: June 08, 2017, 06:42:40 AM »
Hi Craig. I am back yes :) Weekend was just awesome. I will check out your link. So far many has tryed to fix this, but no fix yet as far as I know.
I think I can live without it if I must, but nice to have if I can.

SOR

Offline CRS

*
  •  61 61
    • View Profile
Re: Need some minor LUA adjustments...
« Reply #27 on: June 08, 2017, 07:08:29 AM »
Bob actually has it working.  I have spent about a week back and foward with him, and he has a good handle on the whole thing.  So yes take a look.

Craig.