SimHQ
Previous Thread
Next Thread
Print Thread
Rate Thread
Hop To
Page 1 of 2 1 2
#3154955 12/11/10 01:31 PM
Joined: May 2009
Posts: 7,033
K
Hell Drummer
Hotshot
Hell Drummer
Hotshot
K Offline
Joined: May 2009
Posts: 7,033
Sorry if this is a double post but...

As the title implies, how do I program the 5 LEDs available on the throttle base?!?!

Looked all over the place or manual to no avail.
It's just me?

Peace,
K'mute


Click to reveal..
"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
Inline advert (2nd and 3rd post)

Joined: Mar 2003
Posts: 3,922
Senior Member
Senior Member
Joined: Mar 2003
Posts: 3,922
Can't do it yet......awaiting T.A.R.G.E.T update.


On the Eighth day God created Paratroopers and the Devil stood to attention.
Joined: May 2009
Posts: 7,033
K
Hell Drummer
Hotshot
Hell Drummer
Hotshot
K Offline
Joined: May 2009
Posts: 7,033
*sigh*
Feared that.

Thanks abunch.

K'mute


Click to reveal..
"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
Joined: May 2009
Posts: 7,033
K
Hell Drummer
Hotshot
Hell Drummer
Hotshot
K Offline
Joined: May 2009
Posts: 7,033
So? Now? Are we there yet?


Click to reveal..
"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
Joined: Jul 2005
Posts: 1,508
T
Member
Member
T Offline
Joined: Jul 2005
Posts: 1,508
Almost. The code is being tested.


#6 - Opposing / Left Solo
Virtual Thunderbirds, LLC | Sponsored by Thrustmaster
Teej #3207550 02/14/11 04:58 PM
Joined: May 2009
Posts: 7,033
K
Hell Drummer
Hotshot
Hell Drummer
Hotshot
K Offline
Joined: May 2009
Posts: 7,033
Originally Posted By: Teej
Almost. The code is being tested.


twoweeks

This sounds like waht parents say to kids who asks "So? Now? Are we there yet?"


Click to reveal..
"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
Joined: May 2004
Posts: 103
3
Member
Member
3 Offline
Joined: May 2004
Posts: 103
The code has been released and is available on the Thrustmaster driver site.


Persecutor
a proud member of the 352ndVFG

http://www.352ndfg.com/IL2
Joined: Nov 2010
Posts: 37
H
Junior Member
Junior Member
H Offline
Joined: Nov 2010
Posts: 37
Code works fine, with GUI you can now switch backlight off when not using the Warthog.Smile2
Only wish now, that you could also switch it on/off with the Script Editor. That would make sense for the initial state as explained in the script manual.


***************** Edit **********************************
Sorry, too hasty.. WinkNGrin
The backlight is actually LED 0 (zero) and you can therefore switch it on & off in the Script Editor. clapping

Last edited by hsth; 03/11/11 12:31 AM.
Joined: Aug 2002
Posts: 410
D
Member
Member
D Offline
Joined: Aug 2002
Posts: 410
Hi, I just installed the latest TARGET version, but I dont really see an option for turning off or adjusting backlighting.. dizzy Could one of you, more experienced TARGET guys maybe give me a litlle hint?


Fortes Fortuna Juvat
Joined: Mar 2005
Posts: 1,124
S
Member
Member
S Offline
Joined: Mar 2005
Posts: 1,124
Try this smile

Code:
include "target.tmh"

int main()	// initialize the physical devices and create the virtual devices
{
	if(Init(&EventHandle)) return 1;							// declare the event handler, return on error
	//SetKBLayout(KB_GER);
	
	MapKey(&Joystick, S2, LED(&Throttle, LED_INTENSITY, 0));
	MapKey(&Joystick, S1, LED(&Throttle, LED_INTENSITY, 215));
	MapKey(&Joystick, TG1, LED(&Throttle, LED_ONOFF, LED_CURRENT+LED4^LED2));	// mind the precedence, ^LED MUST be the latest
	MapKeyR(&Joystick, TG1, LED(&Throttle, LED_ONOFF, LED_CURRENT-LED4^LED3));	// mind the precedence, ^LED MUST be the latest
//	ActKey(KEYON+REXEC(0, 500, "ActKey(KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT^LED1));"));
	KeyAxis(&Throttle, THR_FC, 0, AXMAP2(6, LED(&Throttle, LED_INTENSITY, 0),
										 LED(&Throttle, LED_INTENSITY, 45),
										LED(&Throttle, LED_INTENSITY, 90),
											LED(&Throttle, LED_INTENSITY, 135),
											LED(&Throttle, LED_INTENSITY, 180),
											LED(&Throttle, LED_INTENSITY, 215)));
											
	KeyAxis(&Joystick, JOYX, 0, AXMAP2(6,
	LED(&LMFD, LED_INTENSITY, 0),
	LED(&Throttle, LED_INTENSITY, 45),
	LED(&Throttle, LED_INTENSITY, 90),
	LED(&Throttle, LED_INTENSITY, 135),
	LED(&Throttle, LED_INTENSITY, 180),
	LED(&LMFD, LED_INTENSITY, 80)));

	KeyAxis(&Joystick, JOYY, 0, AXMAP2(6,
	LED(&RMFD, LED_INTENSITY, 0),
	LED(&Throttle, LED_INTENSITY, 45),
	LED(&Throttle, LED_INTENSITY, 90),
	LED(&Throttle, LED_INTENSITY, 135),
	LED(&Throttle, LED_INTENSITY, 180),
	LED(&RMFD, LED_INTENSITY, 80)));

	//MapKey(&Joystick, TG1, PULSE+'1');
}

int EventHandle(int type, alias o, int x)
{
	DefaultMapping(&o, x);
}

LED_INTENSITY range from 0 to 255.

This sets the lights at start: LMFD at 50, RMFD at 50, Throttle backlight at 50, LED1, 2 and 3 off, LED4 and 5 on.
Code:
ActKey(PULSE+KEYON+LED(&LMFD, LED_INTENSITY, 50));
ActKey(PULSE+KEYON+LED(&RMFD, LED_INTENSITY, 50));
ActKey(PULSE+KEYON+LED(&Throttle, LED_INTENSITY, 50));
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));


Here are some snippets from my A-10C scipt. Pretty self explanatory.
Code:
//LED1 blinking when TG1 is pressed, stops blinking and sets LED1 to off when TG1 is released
MapKey(&Joystick, TG1, CHAIN((Gun_trigger_stage1), REXEC(0, 200, "ActKey(KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT^LED1));")));
MapKeyR(&Joystick, TG1, EXEC("ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED1));"));

//LED1 is constantly on when TG1 is pressed, LED1 returns to off when TG1 is released
//MapKey(&Joystick, TG1, CHAIN((Gun_trigger_stage1),(LED(&Throttle, LED_ONOFF, LED_CURRENT+LED1))));
//MapKeyR(&Joystick, TG1, LED(&Throttle, LED_ONOFF, LED_CURRENT-LED1));

//Same as above but with LED2 and TG2
MapKey(&Joystick, TG2, CHAIN((Gun_trigger),(LED(&Throttle, LED_ONOFF, LED_CURRENT+LED2))));
MapKeyR(&Joystick, TG2, LED(&Throttle, LED_ONOFF, LED_CURRENT-LED2));

// Joystick Switches
// S4+S1 Toggles intensity on Throttle, LMFD and RMFD simultaneously
MapKeyIO(&Joystick, S1, SEQ(
CHAIN(LED(&LMFD, LED_INTENSITY, 100),D(10),LED(&RMFD, LED_INTENSITY, 100),D(10),LED(&Throttle, LED_INTENSITY, 100)),
CHAIN(LED(&LMFD, LED_INTENSITY, 150),D(10),LED(&RMFD, LED_INTENSITY, 150),D(10),LED(&Throttle, LED_INTENSITY, 150)),
CHAIN(LED(&LMFD, LED_INTENSITY, 255),D(10),LED(&RMFD, LED_INTENSITY, 255),D(10),LED(&Throttle, LED_INTENSITY, 255)),
CHAIN(LED(&LMFD, LED_INTENSITY, 0),D(10),LED(&RMFD, LED_INTENSITY, 0),D(10),LED(&Throttle, LED_INTENSITY, 0)),
CHAIN(LED(&LMFD, LED_INTENSITY, 50),D(10),LED(&RMFD, LED_INTENSITY, 50),D(10),LED(&Throttle, LED_INTENSITY, 50))));


Last edited by Shadow=ASP=; 03/12/11 06:31 PM.
Joined: Aug 2002
Posts: 410
D
Member
Member
D Offline
Joined: Aug 2002
Posts: 410
eek2

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
Joined: Mar 2005
Posts: 1,124
S
Member
Member
S Offline
Joined: Mar 2005
Posts: 1,124
Originally Posted By: Dachs
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.

Joined: Nov 2010
Posts: 37
H
Junior Member
Junior Member
H Offline
Joined: Nov 2010
Posts: 37
Well,

This is a simple solution to put in a script file:
Code:
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.

Joined: Oct 2010
Posts: 83
N
Junior Member
Junior Member
N Offline
Joined: Oct 2010
Posts: 83
Instead of:

Code:
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:

Code:
ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED1-LED2-LED3+LED4+LED5));

Joined: May 2009
Posts: 7,033
K
Hell Drummer
Hotshot
Hell Drummer
Hotshot
K Offline
Joined: May 2009
Posts: 7,033
Thanks for the heads up!

Got it, now trying to find some manual to learn its programming!


Click to reveal..
"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
Joined: Sep 2010
Posts: 104
D
Member
Member
D Offline
Joined: Sep 2010
Posts: 104
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
Joined: May 2009
Posts: 7,033
K
Hell Drummer
Hotshot
Hell Drummer
Hotshot
K Offline
Joined: May 2009
Posts: 7,033
O.O Wonderful!

Thanks a loT!


Click to reveal..
"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
Joined: May 2004
Posts: 103
3
Member
Member
3 Offline
Joined: May 2004
Posts: 103
Originally Posted By: Dimebug
.... 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.


Persecutor
a proud member of the 352ndVFG

http://www.352ndfg.com/IL2
Joined: Sep 2010
Posts: 104
D
Member
Member
D Offline
Joined: Sep 2010
Posts: 104
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

Last edited by Dimebug; 03/15/11 06:57 PM.

Guillaume "Dimebug" Leleve
Joined: May 2004
Posts: 103
3
Member
Member
3 Offline
Joined: May 2004
Posts: 103
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.

Last edited by 352nd Persecutor; 03/17/11 05:25 AM.

Persecutor
a proud member of the 352ndVFG

http://www.352ndfg.com/IL2
Page 1 of 2 1 2

Moderated by  RacerGT 

Link Copied to Clipboard
Quick Search
Recent Articles
Support SimHQ

If you shop on Amazon use this Amazon link to support SimHQ
.
Social


Recent Topics
God Forbid they want to have a bit of fun at work
by NoFlyBoy - 09/22/26 08:50 PM
How a 5" 38 Caliber US Naval Gun Works
by F4UDash4 - 09/19/26 01:20 AM
100% commission based sales
by PanzerMeyer - 09/18/26 04:47 PM
Relativity
by Terl9999 - 09/18/26 04:34 AM
HOA's
by Terl9999 - 09/18/26 04:12 AM
Football
by Terl9999 - 09/18/26 02:42 AM
Flags
by Terl9999 - 09/15/26 10:03 PM
September 15th Battle of Britain Day.
by RedToo - 09/15/26 08:06 PM
Population Patterns
by PanzerMeyer - 09/15/26 03:43 PM
"Problem occurred in connection"
by F4UDash4 - 09/14/26 01:41 PM
Popular Topics(Views)
7,069,307 SAM Simulator
Copyright 1997-2016, SimHQ Inc. All Rights Reserved.

Powered by UBB.threads™ PHP Forum Software 8.0.1