led RGB facil
pour les debutants...
montage led rgb pour les debutants
voici le code
int redPin= 4;
int greenPin = 5;
int bluePin = 6;
void setup() {
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
}
void loop() {
setColor(0, 0, 255);
delay(1000);
setColor(255, 255, 255);
delay(1000);
setColor(4563,556,373);
delay(1000);
}
void setColor(int redValue, int greenValue, int blueValue) {
analogWrite(redPin, redValue);
analogWrite(greenPin, greenValue);
analogWrite(bluePin, blueValue);
}