So this is the code:
#include <WiFiNINA.h>
#include <Wire.h>
#include <GroveColorSensor.h>
int red, green, blue;
GroveColorSensor cS;
void setup() {
Serial.begin(9600);
Wire.begin();
}
void loop() {
cS.readRGB(&red, &green, &blue);
Serial.print("The RGB value are: RGB( ");
Serial.print(red,DEC);
Serial.print(", ");
Serial.print(green,DEC);
Serial.print(", ");
Serial.print(blue,DEC);
Serial.println(" )");
delay(500);
cS.clearInterrupt();
delay(500);
}
The problem is that when I upload it the Arduino crashes (3 short 3 long blinks of the onboard LED in a loop). Why is that?
Could you please post your wiring diagram?
Can you please post a link to the specs for "grove color sensor v1.3"
If you upload the blink example sketch, does that work?
it works with everything else, but the moment I add the GroveColorSensor.h library it stops working. This is the color sensor im talking about.
Arduino | Color sensor
5V | VCC
GND | GND
A5 | SCL
A4 | SDA
Have you tried any other I2C devices with your NanoRP2040?
Are the SDA and SCL pins assignments correct for your Nano?
Are you using the correct library for the version of the board you have? The Seeed page you linked to mentions only versions 1.2 and 2.0.
Have you tried the i²c scanner sketch?
Have you tried another Arduino, such as an Uno?
Have you requested help on on the Seeed forum?
I have used it with an Uno and it worked, so that's a problem with the rp2040 nano. I can't find the V1.3 version, but it looks perfectly like the 1.2, and in the shop where I bought it they said it should be used like the 1.2.
I will try the i2c scanner once I get home
I havent asked on the seed forum yet, but I think if nothing comes out of here im going to do it.
Milan2006:
5V | VCC
Try connecting Vcc of the sensor to 3.3V, not 5V.
system
Closed
December 1, 2022, 7:26am
10
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.