PDA

View Full Version : Axes doing Button action



McGalcri
23rd March 2009, 05:46 PM
Hi guys. Im new here, and... sorry for my english, because I'm Spanish hehe.

Im trying something with my Yoke and ProPedals. I want when I press my right brake (device2) act like my Yoke button 1 (device1). I mean, when I press my right brake pedal, is like im holding my button 1 of my yoke, and when I release it... release the button. Is simple, but...not much english for me to understand the help.

Can someone help me with that script? Thanks to all!

Bob Church
23rd March 2009, 09:37 PM
Hi McGalcri,

Sure. The right brake would be js2.a2. The Yoke button would be js1.b1. The brake puts out "0" at the top of it's travel, "255" when it's fully pressed. I'll just figure you want it at the halfway point, so the little script would look like this:


script
cms.b1 = js1.b1 OR [ js2.a2 > 128 ];
endScript

If you need to have it activate at some other point then midpoint, just play with the "128" value to get it where you want. A lower value will make it activate closer to the top, a higher value closer to the bottom

Up in the GUI, you'd need to unassign the Yoke button, don't assign it to anything, and then send and then assign Button 1 on the CMS Controls tab to go to the the Control Manager Device button that you want it to go to.

If you don't know how to create script, it's really simple. Just create the map, but add the CMS Controls. That will make the CM Editor available, it will be an empty script, just some header info and then a "script" and and "endScript" statement. Just make it look like the script above, save the map and download it. Remember to unassign the button on the yoke, the logic will set it up so it works again.

If you get lost, just let me know and I'll help you sort it out.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

McGalcri
24th March 2009, 01:20 AM
WOW!!! man!!! Thanks a lot!! :lol: Is perfect!!! exactly that I want! hahahahahaha. You are awesome man, thanks again! :roflmao:

:w00t::w00t::w00t:

PureEvil
7th April 2009, 04:06 PM
script

cms.b1 = js2.a2 > 64;
cms.b2 = js2.a1 < 192;
cms.b3 = js2.a2 < 192;
cms.b4 = js2.a1 > 64;

endScript


trying to get ministick on throttle pro to act like 4 bottons. not sure what have to be changed in GUI, but getting error message when trying to download the profile to hardware.
any help will be nice.

no help required anymore, my stupid mistake missing [ ] and in differnt way > < .

Bob Church
8th April 2009, 01:05 AM
Hi PureEvil,

You need to put square brackets around the comparisons or they aren't seen correctly as being comparisons. Make it look like this:


script

cms.b1 = [ js2.a2 < 64 ];
cms.b2 = [ js2.a1 > 192 ];
cms.b3 = [ js2.a2 > 192 ];
cms.b4 = [ js2.a1 < 64 ];

endScript

Also, your script has the comparisons backwards. You want (normally) "< 64" and "> 192". The way it is, all four buttons will be on at center and then one or more will turn on as you cross the thresholds. The value will be 128 at center, so 64 is about halfway to the left or up, 192 is about halfway to the right or back. I've changed them in the above. If you really wanted the buttons all on at center, you'll need to flip them back.

While you've got the script editor open and the script loaded, there a button up on the tool bar over toward the left with a red check on it. That will check the script and give you an idea of where the errors are. The error is usually on or just before the line that where the check leaves you when it's done. If it will give you the okay, then the script will download. Might not work, it could be buggy, but it will download.

Hope this helps!

Best regards,

- Bob

The StickWorks
http://www.stickworks.com