PDA

View Full Version : POV Hat as Button 17?


ruggbutt
19-04-2005, 06:22 AM
I'm trying to use a script to toggle commands to my wingman to turn radar on/off for LOMAC. I'd like to do this w/the POV Up hat on the Fighterstick. I've mapped it to CM Device 1, Button 17. I use CMS buttons 19 and 20 for the commands (radar on/radar off). In the calibration screen B17 shows up, but it won't work w/my script. I know there isn't an actual button 17 on the stick, just not sure how to script this. The script works great w/all the other buttons.


SEQUENCE
// // First Command Operates on the first press of Joystick 1 Button 17
WHILE( JS1.B17 );
CMS.B19 = TRUE;
DELAY( 2 );
CMS.B19 = FALSE;
DELAY( 2 );
// // Second Command Operates on the second press of Joystick 1 Button 17
WHILE( JS1.B17 );
CMS.B20 = TRUE;
DELAY( 2 );
CMS.B20 = FALSE;
DELAY( 2 );
ENDSEQUENCE

How do I make this bad boy work? I'm using the unshifted command as keypad 8 (for up to emulate POV) and shifted I want the wingman command to work.

Bob Church
19-04-2005, 08:01 AM
Hi Ruggbutt,

The POV buttons aren't part of the normal numbering scheme, but they are available in the script as js1.b24..js1.b31, so it should be "while( js1.b25 )...". Otherwise it should do as it's programmed.

I'm not sure that's what you want, though. The way you've got it set up, cms.b19 is going to cycle on for 2 scans and off for 2 scans continuously while the button is held. If you just want it to send 1 of the commands per click, it should probably be "wait( js1.b25 )..." and the second DELAY is really superfluous. I'm not really sure what you're trying to do, though. The cycling delay may be just what you're after.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

ruggbutt
19-04-2005, 02:49 PM
If you hit the button once it cycles the first command, then hit it again it cycles the second. Problem is that it's not working w/POV Up in Direct X mode, as CM Device 1, Button 17. It works w/any of the other buttons, I use it to cycle the Wingman command Jammers On/Jammers Off. I just tested it w/JS1, B9 and the script works. Do I need to modify something in the script when using a button that I have assigned to a different number?

Bob Church
19-04-2005, 09:17 PM
Hi Ruggbutt,

>> If you hit the button once it cycles the first command, then hit it again it cycles the second. Problem is that it's not working w/POV Up in Direct X mode, as CM Device 1, Button 17. It works w/any of the other buttons, I use it to cycle the Wingman command Jammers On/Jammers Off. I just tested it w/JS1, B9 and the script works. Do I need to modify something in the script when using a button that I have assigned to a different number? <<

Just reading back over my post and I made a mistake there. Sorry about that. It should be buttons 25 through 32, Hat Up is button 25. I had it right in the "WHILE" statements, but it was wrong in the first reference. Would that explain it?

As to the question, no. The buttons should all look the same, it shouldn't matter where they come from or go to.

Let me know if it's not the button 24/button 25 reference and we can dig a little deeper.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

ruggbutt
19-04-2005, 09:38 PM
Sweet, that works! I take it that POV Right is Button 26, Down is 27 and Left is 28?

Bob Church
19-04-2005, 10:22 PM
Hi Ruggbutt,

>> Sweet, that works! I take it that POV Right is Button 26, Down is 27 and Left is 28? <<

Basically yes, but it's an 8-way so 26 is Up/Right, 27 is right, 28 is Down/Right, etc. They just go around clockwise, though. The Users Guide mentions them in the section on Variables back in the CMS programming section. B21 through B24 can be referenced, too. They tell you whether the hat is in the center or not. When it was sending one command per click, I suspect that it was responding to B24 opening when you pushed the Hat off center. Those are back in the section on Predefined Variables and Contstants.

Anyway, I'm glad that's sorted it out for you. Sorry for the mixup.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com