I am not able to use RGB LED in nano 33iot kindly help
Please describe the problem and post a sketch that shows the problem
Thinking about it, does the Nano 33 IOT actually have an RGB LED ?
The Nano 33 BLE does have such an LED. Which board do you have ?
I have nano 33iot it has RGB on board
Can you please provide a link to the details of that and post your sketch
Nice device, currently I´m looking for that type.
Does it has a RGB led onboard?
Post the datasheet.
btw: why do you ask on Arduino forum for a datasheet of an official Arduino board?
there is no RGB LED on Nano 33 IoT. there was no space for it. Nano 33 BLE has less chips so there was space left for a RGB LED
void setup() {
// nothing to do here
}
void loop() {
// set the RGB LED to red
analogWrite(LEDR, 255); // set red component to maximum brightness
analogWrite(LEDG, 0); // set green component to off
analogWrite(LEDB, 0); // set blue component to off
delay(1000); // wait for 1 second
// set the RGB LED to green
analogWrite(LEDR, 0); // set red component to off
analogWrite(LEDG, 255); // set green component to maximum brightness
analogWrite(LEDB, 0); // set blue component to off
delay(1000); // wait for 1 second
// set the RGB LED to blue
analogWrite(LEDR, 0); // set red component to off
analogWrite(LEDG, 0); // set green component to off
analogWrite(LEDB, 255); // set blue component to maximum brightness
delay(1000); // wait for 1 second
}
Not surprisingly that sketch does not even compile for a Nano 33 IOT. Where did you get it from ?
type or paste code here
```void setup() {
// nothing to do here
}
void loop() {
// set the RGB LED to red
analogWrite(LEDR, 255); // set red component to maximum brightness
analogWrite(LEDG, 0); // set green component to off
analogWrite(LEDB, 0); // set blue component to off
delay(1000); // wait for 1 second
// set the RGB LED to green
analogWrite(LEDR, 0); // set red component to off
analogWrite(LEDG, 255); // set green component to maximum brightness
analogWrite(LEDB, 0); // set blue component to off
delay(1000); // wait for 1 second
// set the RGB LED to blue
analogWrite(LEDR, 0); // set red component to off
analogWrite(LEDG, 0); // set green component to off
analogWrite(LEDB, 255); // set blue component to maximum brightness
delay(1000); // wait for 1 second
}
void setup() {
// nothing to do here
}
void loop() {
// set the RGB LED to red
analogWrite(LEDR, 255); // set red component to maximum brightness
analogWrite(LEDG, 0); // set green component to off
analogWrite(LEDB, 0); // set blue component to off
delay(1000); // wait for 1 second
// set the RGB LED to green
analogWrite(LEDR, 0); // set red component to off
analogWrite(LEDG, 255); // set green component to maximum brightness
analogWrite(LEDB, 0); // set blue component to off
delay(1000); // wait for 1 second
// set the RGB LED to blue
analogWrite(LEDR, 0); // set red component to off
analogWrite(LEDG, 0); // set green component to off
analogWrite(LEDB, 255); // set blue component to maximum brightness
delay(1000); // wait for 1 second
}
Use code tags to format code for the forum
`
Have you tried compiling that sketch with the Nano 33 IOT as the target board ?
Yes
Then you will have found that it does not compile
One reason for that is the fact that the LEDR, LEDG and LEDG constants are not defined. That is because they are not needed because the Nano 33 IOT does not need pin numbers for the red, green and blue LEDs of the RGB LED because it does not have one