Previous Thread
Next Thread
Print Thread
Rate This Thread
Hop To
#4271229 - 06/18/16 01:11 AM LED back-light control with Throttle friction lever  
Joined: May 2006
Posts: 123
DarKcyde Offline
Member
DarKcyde  Offline
Member

Joined: May 2006
Posts: 123
Just some code I wrote, because the idea popped into my head, and I'm still amazed at the power of Target programming.

It changes LED backlight levels while holding S3 and moving the THR_FC lever. As a bonus, if you have MFDs, it will smoothly move through all 0-255 brightness levels. No changes to your existing programming, just replace the EventHandle function at the bottom of any script.

You could probably have it automatically find your Shift button, but I just set it to S3. Change as required.

Code:
int EventHandle(int type, alias o, int x) {
int LED_BRT;
	if (&o == &Throttle & x == THR_FC & Joystick[S3]) {
		LED_BRT = (AxisVal(Throttle[THR_FC], &axdata) - 32766) / 256 * -1;
		ActKey(PULSE+KEYON+LED (&Throttle, LED_INTENSITY, LED_BRT));
	}
	else DefaultMapping(&o, x);
}

Inline advert (2nd and 3rd post)

#4271342 - 06/18/16 02:25 PM Re: LED back-light control with Throttle friction lever [Re: DarKcyde]  
Joined: Mar 2011
Posts: 14
Thermal Offline
Junior Member
Thermal  Offline
Junior Member

Joined: Mar 2011
Posts: 14
Nice!

#4273439 - 06/25/16 10:10 PM Re: LED back-light control with Throttle friction lever [Re: DarKcyde]  
Joined: Jan 2001
Posts: 2,477
HomeFries Offline
Air Dominance Project
HomeFries  Offline
Air Dominance Project
Member

Joined: Jan 2001
Posts: 2,477
Simple and elegant. Very nice.


-Home Fries

"Pacifism is a shifty doctrine under which a man accepts the benefits of the social group without being willing to pay - and claims a halo for his dishonesty."
- Robert A. Heinlein

The average naval aviator, despite the sometimes swaggering exterior, is very much capable of such feelings as love, affection, intimacy, and caring. These feelings just don't involve anyone else.


Moderated by  RacerGT 

Quick Search
Recent Articles
Support SimHQ

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


Recent Topics
Dickey Betts was 80
by Rick_Rawlings. 04/19/24 01:11 AM
Exodus
by RedOneAlpha. 04/18/24 05:46 PM
Grumman Wildcat unique landing gear
by Coot. 04/17/24 03:54 PM
Peter Higgs was 94
by Rick_Rawlings. 04/17/24 12:28 AM
Whitey Herzog was 92
by F4UDash4. 04/16/24 04:41 PM
Anyone can tell me what this is?
by NoFlyBoy. 04/16/24 04:10 PM
10 Years ago MV Sewol
by wormfood. 04/15/24 08:25 PM
Pride Of Jenni race win
by NoFlyBoy. 04/15/24 12:22 AM
It's Friday: grown up humor for the weekend.
by NoFlyBoy. 04/12/24 01:41 PM
OJ Simpson Dead at 76
by bones. 04/11/24 03:02 PM
Copyright 1997-2016, SimHQ Inc. All Rights Reserved.

Powered by UBB.threads™ PHP Forum Software 7.6.0