|
|
|
#3232642 - 03/12/11 02:22 PM
Re: 5 LED Programming
[Re: komemiute]
|
Member
Registered: 08/13/02
Posts: 309
Loc: Denmark
|
And here I was, looking for a simple button or slider in the GUI.. Thanks, I'll have a look at it. Somehow I miss good ole Foxy!
_________________________
Fortes Fortuna Juvat
|
|
Top
|
|
|
|
#3232674 - 03/12/11 03:00 PM
Re: 5 LED Programming
[Re: Dachs]
|
Member
Registered: 03/04/05
Posts: 1116
Loc: Ski, Norway
|
And here I was, looking for a simple button or slider in the GUI.. There are simple buttons and sliders in the GUI editor, but if you want to change light intensity or make the lights behave in a specific manner according to button-pushing ingame you have to script them.
|
|
Top
|
|
|
|
#3232814 - 03/12/11 05:44 PM
Re: 5 LED Programming
[Re: komemiute]
|
Junior Member
Registered: 11/12/10
Posts: 37
|
Well, This is a simple solution to put in a script file: MapKey(&Throttle, APUON, CHAIN(PULSE+Electric_Power_Switch, LED(&Throttle, LED_ONOFF, LED_CURRENT+LED0))); //Electric Power & Backlight On
MapKey(&Throttle, APUOFF, LED(&Throttle, LED_ONOFF, LED_CURRENT-LED0)); //Electric Power & Backlight Off
The APU switch now turns the internal power on in FC2 and at the same time the backlight of the throttle. And when the switch is turned off, the backlight is turned off. Now I can keep the throttle plugged in without lights burning all day.
|
|
Top
|
|
|
|
#3233381 - 03/13/11 02:42 PM
Re: 5 LED Programming
[Re: Shadow=ASP=]
|
Junior Member
Registered: 10/31/10
Posts: 40
|
Instead of: ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED1));
ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED2));
ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED3));
ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT+LED4));
ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT+LED5)); you can also write: ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED1-LED2-LED3+LED4+LED5));
|
|
Top
|
|
|
|
#3233816 - 03/14/11 06:29 AM
Re: 5 LED Programming
[Re: komemiute]
|
Hell Drummer
Senior Member
Registered: 05/03/09
Posts: 2812
|
Thanks for the heads up!
Got it, now trying to find some manual to learn its programming!
_________________________
"Himmiherrgottksakramentzefixhallelujah!" Para_Bellum
"It takes forever +/- 2 weeks for the A-10 to get anywhere significant..." Ice
"Ha! If it gets him on the deck its a start!" MigBuster
"What people like and what critics praise are rarely the same thing. 'Critic' is just another one of those unnecessary, overpaid, parasitic jobs that the human race has churned out so that clever slackers won't have to actually get a real job and possibly soil their hands." Sauron
|
|
Top
|
|
|
|
#3233854 - 03/14/11 07:54 AM
Re: 5 LED Programming
[Re: komemiute]
|
Member
Registered: 09/18/10
Posts: 103
Loc: France
|
All this stuff can be Controlled from the graphical interface, everything is in the manual. Most of the job is done from the virtual Keyboard/mouse/joystick window. You can access it from the event specs window.
_________________________
Guillaume "Dimebug" Leleve
|
|
Top
|
|
|
|
#3233857 - 03/14/11 08:00 AM
Re: 5 LED Programming
[Re: komemiute]
|
Hell Drummer
Senior Member
Registered: 05/03/09
Posts: 2812
|
O.O Wonderful!
Thanks a loT!
_________________________
"Himmiherrgottksakramentzefixhallelujah!" Para_Bellum
"It takes forever +/- 2 weeks for the A-10 to get anywhere significant..." Ice
"Ha! If it gets him on the deck its a start!" MigBuster
"What people like and what critics praise are rarely the same thing. 'Critic' is just another one of those unnecessary, overpaid, parasitic jobs that the human race has churned out so that clever slackers won't have to actually get a real job and possibly soil their hands." Sauron
|
|
Top
|
|
|
|
#3234748 - 03/15/11 09:05 AM
Re: 5 LED Programming
[Re: Dimebug]
|
Member
Registered: 05/01/04
Posts: 103
Loc: Southern California
|
.... everything is in the manual. .... Dimebug, leaving aside the differences in file format between the GUI and the Script Editor and their apparent incompatibility one with the other, where in the manual(s) are any references to the scripting that controls the LEDs? I've read both several times and searched in vain for an LED section in either the TARGET_User_Manual_v1.5_ENG.pd or the TARGET_Script_Editor_Basics_v1.4_ENG.pdf which, unless I'm missing something really big (which is possible, of course) are the latest manual versions. My experience with the two engines (GUI and scripting) leads me to use the Scripting Editor solely, which has no visual clues to programming syntax and nothing that I've found dealing with LEDs. Obviously programming them can be done, but the manuals are not clear on the subject, at least not to me. Perhaps there is an update I've missed or one on its way (I hope so). Or maybe, like so many things, it is there right in front of my nose and I'm not recognizing it.
|
|
Top
|
|
|
|
#3235080 - 03/15/11 02:55 PM
Re: 5 LED Programming
[Re: komemiute]
|
Member
Registered: 09/18/10
Posts: 103
Loc: France
|
GUI led management is page 24 to 27 of the gui manual (you can read it from the "how do i ?" list of the Target main page.
For the script, looks like the manual available on the TM website is the older one, not the latest. I'm gonna ask for this to be changed.
this should help you :
LED and backlight Control The script language offer the possibility to control LED state and Backlight intensity of several controllers like the HOTAS Warthog Throttle and the MFD pack. T.A.R.G.E.T support some device that where developed a long time before the software was created. The MFDs lightning support in the T.A.R.G.E.T software is a bonus. If you are experiencing issue like MFDs not responding, stop the script execution, simply unplug and re-plug the MFDs and launch the script. This can happen If the USB port was gone in "sleep" mode while MFDs where not used.
Turn "ON" a LED Syntax:
LED(&input device, LED_ONOFF,LED_CURRENT operator LEDnumber);
The operator is used to control the status:
- will turn "OFF"
+ will turn "ON"
^ will revert the LED status
Example using a MapKey function (here, we turn" ON" LED 1 of the Warthog Throttle when joystick Hat 2 Up position is pressed): MapKey(&Joystick, H2U, LED(&Throttle, LED_ONOFF, LED_CURRENT+LED1));
Turn "OFF" a LED
LED(&input device, LED_ONOFF,LED_CURRENT-LEDnumber);
Notice that we've just change the + for a - to turn off the LED. Now let's turn "OFF" our Throttle LED1 each time Hat 2 down is pressed.
MapKey(&Joystick, H2D, LED(&Throttle, LED_ONOFF, LED_CURRENT-LED1));
Change the status of a LED Sometimes, you may want to change the status of a LED whatever his current state (to make it blink for example).
LED(&LMFD, LED_ONOFF, LED_CURRENT^LED2)
MapKey(&Joystick, H4P, LED(&RMFD, LED_ONOFF, LED_CURRENT^LED2));
Each time we press the hat 4 push button, the LED 2 of the right MFD will change of state.
The backlight intensity is almost controlled the same way. The difference is that we have different backlight steps. You can control the Backlighting intensity from null to full. Warthog throttle offers 6 levels of intensity, MFDs have 256 different levels of intensity, from 0 to 255.
The throttle and the MFDs share the same command, but as the throttle doesn't offer the same number of levels of lighting, you have to divide the full range of value.
0 to 42 is OFF 43 to 85 is level 1 86 to 128 is level 2 129 to 171 is level 3 172 to 214 is level 4 215 to 255 is level 5
Syntax:
LED(&Input Device, LED_INTENSITY, value of the intensity)
Let's imagine that we want to control the left MFD backlight power with the Warthog throttle EAC switch.
MapKey(&Throttle, EACON, LED(&LMFD, LED_INTENSITY, 255)); MapKey(&Throttle, EACOFF, LED(&LMFD, LED_INTENSITY, 0));
Start a configuration with all lights in the right status. It's possible to initialize the LED status when launching the script. For this we use the advanced programming code (see later). The commands must be placed in the same part of the script than your MapKey functions.
//initialize backlight power ActKey(PULSE+KEYON+LED(&Throttle, LED_INTENSITY, 129)); //set Throttle backlight power to middle ActKey(PULSE+KEYON+LED(&LMFD, LED_INTENSITY, 129)); //set left MFD backlight power to middle ActKey(PULSE+KEYON+LED(&RMFD, LED_INTENSITY, 129)); //set right MFD backlight power to middle
//initialize LED status all "OFF" ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED1)); //set LED 1 OFF ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED2)); //set LED 2 OFF ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED3)); //set LED 3 OFF ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED4)); //set LED 4 OFF ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED5)); //set LED 5 OFF ActKey(PULSE+KEYON+LED(&LMFD, LED_ONOFF, LED_CURRENT-LED1)); //set left MFD LED 1 OFF ActKey(PULSE+KEYON+LED(&LMFD, LED_ONOFF, LED_CURRENT-LED2)); //set left MFD LED 2 OFF ActKey(PULSE+KEYON+LED(&RMFD, LED_ONOFF, LED_CURRENT-LED1)); //set right MFD LED 1 OFF ActKey(PULSE+KEYON+LED(&RMFD, LED_ONOFF, LED_CURRENT-LED2)); //set right MFD LED 2 OFF
Edited by Dimebug (03/15/11 02:57 PM)
_________________________
Guillaume "Dimebug" Leleve
|
|
Top
|
|
|
|
#3235437 - 03/15/11 11:35 PM
Re: 5 LED Programming
[Re: komemiute]
|
Member
Registered: 05/01/04
Posts: 103
Loc: Southern California
|
Dimebug,
Very helpful. Thank you for taking the time to explain all that -- lots of typing and greatly appreciated.
Actually, both the GUI and script editor manuals on the Thrustmaster website were one version old but they've been updated (on March 15) and now contain the information you described.
Edited by 352nd Persecutor (03/17/11 01:25 AM)
|
|
Top
|
|
|
|
|
|
| |