Seeeduino Nano & Grove Chainable RGB LED - can't get it to work

Hi everyone,
I just bought my first Seeed products - Seeeduino Nano and the Grove Chainable RGB LED. I took the CycleThroughColors example and changed the pin numbers to 9 and 8 - I could not find any documentation about which pins the on board Grove header uses so I guessed those based on the schematic Hopefully those numbers are correct. I also tried 8 and 9.

#define NUM_LEDS  1

ChainableLED leds(9, 8, NUM_LEDS);

Infortunately after uploading the sketch the LED ligths up but that is about it. No change in color, nothing.

Could you please confirm I have the correct pin numbers and what should I try to debug this? I also tried a different Chainable LED module but that behaves the same, apart from starting on a different color.

Hi @Regis
Could you connect the RGB LED to D7 and D8, then try below code?

/*

  • Example of using the ChainableRGB library for controlling a Grove RGB.
  • This code cycles through all the colors in an uniform way. This is accomplished using a HSB color space.
    */

#include “ChainableLED.h”

#define NUM_LEDS 5

ChainableLED leds(7, 8, NUM_LEDS);

void setup()
{
leds.init();
}

float hue = 0.0;
boolean up = true;

void loop()
{
for (byte i=0; i<NUM_LEDS; i++)
leds.setColorHSB(i, hue, 1.0, 0.5);

delay(50);

if (up)
hue+= 0.025;
else
hue-= 0.025;

if (hue>=1.0 && up)
up = false;
else if (hue<=0.0 && !up)
up = true;
}

Hello @jiachenglu and apologies for the very late reply.

I can confirm that D7 & D8 works.

I have measured continuity between the groove connector and the other pins and I finally realised SDA & SLC are connected to A4 & A5 pins which are also D18 and D19.

So in order to use the built-in grove connector on Seeeduino Nano the appropriate line of the demo script needs to be:

ChainableLED leds(19, 18, NUM_LEDS);

Yes, it is backwards. Maybe I am just dumb but this does not seem very obvious or user friendly to me… :slight_smile: