Bug or Intended Operation? (Regarding led_set)
3 posts
• Page 1 of 1
Bug or Intended Operation? (Regarding led_set)
i have been using led_set with negative numbers so that the brightness of the led being set is the same as the config, but it seems that setting a led with the same color (negative) gets "added"? this has the result that the led is much brighter than the setting. here some code which can produce the issue. press and hold R1 and you will see the actual brightness of the led (only on the T2) is much brighter than is should be as set inside the "Device Configuration" tab. This issue is really only noticeable in dark room (where i game) and with the "Default LED intensity" set to a very low setting.
Please clarify J2Kbr if this is a bug or intended, and if its a bug I will make a issue on the github
Please clarify J2Kbr if this is a bug or intended, and if its a bug I will make a issue on the github
- Code: Select all
uint8 Color = 'a';
init {
LED(Color);
}
main {
if(get_val(BUTTON_4)) { LED(Color); }
}
void LED(char i) { //Lower case is device configured brightness, Upper case is Max brightness
fix32 c1, c2, c3, c4;
if(i == 'B') {c1 = 100.0; c2 = 0.00; c3 = 0.00; c4 = 0.00;} // Blue @ MAX Brightness
if(i == 'R') {c1 = 0.00; c2 = 100.0; c3 = 0.00; c4 = 0.00;} // Red @ MAX Brightness
if(i == 'G') {c1 = 0.00; c2 = 0.00; c3 = 100.0; c4 = 0.00;} // Green @ MAX Brightness
if(i == 'P') {c1 = 0.00; c2 = 0.00; c3 = 0.00; c4 = 100.0;} // Pink @ MAX Brightness
if(i == 'C') {c1 = 100.0; c2 = 0.00; c3 = 100.0; c4 = 0.00;} // Cyan @ MAX Brightness
if(i == 'A') {c1 = 0.00; c2 = 100.0; c3 = 100.0; c4 = 0.00;} // Amber @ MAX Brightness
if(i == 'W') {c1 = 100.0; c2 = 100.0; c3 = 100.0; c4 = 100.0;} // White @ MAX Brightness
if(i == 'O') {c1 = 0.0; c2 = 0.0; c3 = 0.0; c4 = 0.0;} // OFF
if(i == 'b') {c1 = -100.0; c2 = 0.00; c3 = 0.00; c4 = 0.00;} // Blue @ Default Brightness (As per device config)
if(i == 'r') {c1 = 0.00; c2 = -100.0; c3 = 0.00; c4 = 0.00;} // Red @ Default Brightness (As per device config)
if(i == 'g') {c1 = 0.00; c2 = 0.00; c3 = -100.0; c4 = 0.00;} // Green @ Default Brightness (As per device config)
if(i == 'p') {c1 = 0.00; c2 = 0.00; c3 = 0.00; c4 = -100.0;} // Pink @ Default Brightness (As per device config)
if(i == 'c') {c1 = -100.0; c2 = 0.00; c3 = -100.0; c4 = 0.00;} // Cyan @ Default Brightness (As per device config)
if(i == 'a') {c1 = 0.00; c2 = -100.0; c3 = -100.0; c4 = 0.00;} // Amber @ Default Brightness (As per device config)
if(i == 'w') {c1 = -100.0; c2 = -100.0; c3 = -100.0; c4 = -100.0;} // White @ Default Brightness (As per device config)
led_set(LED_1, c1, 0);
led_set(LED_2, c2, 0);
led_set(LED_3, c3, 0);
led_set(LED_4, c4, 0);
}
- creedkiller
- Lieutenant
- Posts: 293
- Joined: Fri Mar 17, 2017 4:08 pm
Re: Bug or Intended Operation? (Regarding led_set)
yes, it seems to be a bug, appreciated if add to GitHub.
As temporary workaround use event_active instead:
As temporary workaround use event_active instead:
- Code: Select all
if(event_active(BUTTON_4)) { LED(Color); }
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
Re: Bug or Intended Operation? (Regarding led_set)
J2Kbr wrote:yes, it seems to be a bug, appreciated if add to GitHub.
As temporary workaround use event_active instead:
- Code: Select all
if(event_active(BUTTON_4)) { LED(Color); }
thank you, issue created https://github.com/J2Kbr/TitanTwo/issues/98
- creedkiller
- Lieutenant
- Posts: 293
- Joined: Fri Mar 17, 2017 4:08 pm
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 84 guests