RGB.control not working

Hi,

I am trying to turn of the RGB led on the RedBoard as a test but I can’t get it to work.

Test code:

void setup()
{
  RGB.control(true);
}

void loop()
{
  RGB.color(0, 0, 0);
}

After RedBoard reboot, the RGB stay on breathing cyan. Any help will be great.

[Edit] Can you move this question into troubleshooting? Sorry about that its under tutorials.

Mod Edit (@harrisonhjones): Done and duplicate post merged

What version of system firmware are you compiling again? I have a RedBoard @ Home so I can test when I get home

Also make sure your device actually got the new firmware :wink:
Try adding an additional foolproof feedback like different patterns of D7 blinks or Serial.print() statements.

1 Like

After flashing the new test case few times into the RedBoard, it finally work with above case. I guess the firmware did not get updated. Then I went into testing more test cases and I found the below code would not turn off the RGB:

void setup()
{
  Serial.begin(9600);
 while(! htu.begin()){
  	Serial.println("HTU21D not found");
  	delay(1000);
 }
RGB.control(true);
}

void loop()
{
  RGB.color(0, 0, 0);
}

To get it to work, I add another RGB.control as below:

void setup()
    {
     RGB.control(true);
      Serial.begin(9600);
     while(! htu.begin()){
      	Serial.println("HTU21D not found");
      	delay(1000);
     }
    RGB.control(true);
    }

void loop()
{
  RGB.color(0, 0, 0);
}

This time I make sure the firmware get updated. :smile: But I want to find out why I needed to call RGB.control twice to get the led to turn off.

That’s not normal nor intended.
Although your code does not show everything, but the cause might be hidden in these parts.
One (unlikely) reason might be that any used library also “messes” with RGB or just blocks and prevents your code from reaching the second RGB.control() command.
Adding a blink in loop() might tell that.

The system firmware is 0.6.1-rc.1.

@harrisonhjones, @ScruffR , I found the problem after loading into my full testing board instead of the Redboard. Its the missing parts in the redboard that cause an infinite loop in the while loop. I just need one RGB.control in the setup, it could be place either top or bottom of the setup (tested), but I think it could be anywhere in the setup. Thanks for the help. :smile: ps. @ScruffR, the blink suggestion really help for debugging.

2 Likes