Code help
4 posts
• Page 1 of 1
Code help
I'm a new owner of the T2 and I'm trying to learn how to program it. Here is what I am wanting to do:
When I press BUTTON_12 for 1500 milliseconds, I want BUTTON_5 activated and held in until I press BUTTON_16
Thanks,
SE
When I press BUTTON_12 for 1500 milliseconds, I want BUTTON_5 activated and held in until I press BUTTON_16
Thanks,
SE
-
SouthernEagle - Private First Class
- Posts: 2
- Joined: Sun Aug 11, 2019 8:36 pm
Re: Code help
- Code: Select all
bool toggle;
main
{
if(get_actual(BUTTON_12) && time_active(BUTTON_12) > 1500)
{
toggle = 1;
}
else if(event_active(BUTTON_16))
{
toggle = 0;
}
if(toggle== 1)set_val(BUTTON_5, 100.0);
}
- bonefisher
- Lieutenant General
- Posts: 5413
- Joined: Thu Jan 29, 2015 10:49 am
4 posts
• Page 1 of 1
Return to GPC2 Script Programming
Who is online
Users browsing this forum: No registered users and 104 guests