Démarrer
Câblage vers l’ESP32
| Broche du capteur | Broche ESP32 | Statut | Rôle |
|---|---|---|---|
| Pin 1 (GND) | GND | Requis | Terrain d'entente |
| Pin 2 (R) | GPIO25 | Requis | Canal rouge (via une résistance de 180 Ω) |
| Pin 3 (G) | GPIO26 | Requis | Canal vert (via une résistance de 100 Ω) |
| Pin 4 (B) | GPIO27 | Requis | Canal bleu (via résistance 100Ω) |

Code
Aucune bibliothèque à installer.
#define RED_PIN 10
#define GREEN_PIN 11
#define BLUE_PIN 12
void setup() {
pinMode(RED_PIN, OUTPUT);
pinMode(GREEN_PIN, OUTPUT);
pinMode(BLUE_PIN, OUTPUT);
}
void loop() {
analogWrite(RED_PIN, 255); // Red at full brightness
analogWrite(GREEN_PIN, 0); // Green off
analogWrite(BLUE_PIN, 0); // Blue off
delay(1000);
analogWrite(RED_PIN, 0);
analogWrite(GREEN_PIN, 255); // Green at full brightness
analogWrite(BLUE_PIN, 0);
delay(1000);
analogWrite(RED_PIN, 0);
analogWrite(GREEN_PIN, 0);
analogWrite(BLUE_PIN, 255); // Blue at full brightness
delay(1000);
}
Brochage
| Broche | Type | Description |
|---|---|---|
| Pin 1 (GND) | Power | Cathode commune (masse)Connectez-vous à GND |
| Pin 2 (R) | Communication | Anode LED rougeTension directe de 1,8 V, résistance de 180 Ω |
| Pin 3 (G) | Communication | Anode LED verteTension directe de 2,8 V, résistance de 100 Ω |
| Pin 4 (B) | Communication | Anode LED bleueTension directe de 2,8 V, résistance de 100 Ω |

Caractéristiques
Le KY-016 est un module LED RVB capable d'afficher une large gamme de couleurs en ajustant la luminosité de ses LED rouge, verte et bleue. Il convient à diverses applications nécessitant un retour visuel coloré.
| Caractéristique | Valeur |
|---|---|
| Weight | 2 g |
| Dimensions | 10 x 10 x 5 mm |
| Forward Current | 20mA per channel |
| Operating Voltage | 3.3V - 5V |
| Forward Voltage (Red) | 1.8V |
| Forward Voltage (Green, Blue) | 2.8V |
