GROVE RGB LED + ULTRASONIC SENSOR

Hellow everybody,

I start my project to finish my Bachelors in Mecatronics Engineering, so my problem is:
When i put Serial.begins (9600) the ultrasonic sensor work but the leds dont,and if i cut the Serial.begins the Leds works but the sensor dont.

Anyone know how i can combine the led and the ultrasonic sensor?

Thanks in Advance

Enrico Piozzi

The Grove RGB leds use serial communcations and uses the standard Arduino serial pins 0 & 1, BUT the RGB leds use a different serial protocol to the Arduino Serial!

So you can’t just use both serial protocols.

Maybe you could try and enable one, use if, then enable the other serial coms mode, but it may not work, or may well have problems!

I think you can change the pins used by the RGB leds and that will work and then you can still use the Arduino serial on pins 0 & 1. I don’t have time to test this just now, but PM me if you need more help.

I have now confirmed - you can use other pins instead of pins 0 & 1, so that you can also use the Arduino serial as tthe same time.

Hi Enrico ,
Sorry for the late reply , have you solve your issue ?
You can change the port of GROVE RGB LED , don’t use digital port 0/1 . And then change the port number in the code

// connect to digital 0,1 int Clkpin = 0; int Datapin = 1;

Deray