Bug or Intended Operation? (Regarding led_set)

Titan Two general support. Questions, firmware update, feature request.

Bug or Intended Operation? (Regarding led_set)

Postby creedkiller » Mon Jan 01, 2018 8:20 pm

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

Capture.PNG
Capture.PNG (20.77 KiB) Viewed 295 times


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
Lieutenant
 
Posts: 293
Joined: Fri Mar 17, 2017 4:08 pm

Re: Bug or Intended Operation? (Regarding led_set)

Postby J2Kbr » Wed Jan 10, 2018 10:39 am

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); }
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Bug or Intended Operation? (Regarding led_set)

Postby creedkiller » Thu Jan 11, 2018 9:41 pm

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
Lieutenant
 
Posts: 293
Joined: Fri Mar 17, 2017 4:08 pm


Return to Titan Two Device

Who is online

Users browsing this forum: No registered users and 84 guests