Arduino Esplora Code Clignotant

This sketch blinks the Esplora’s RGB LED. It goes through all three primary colors (red, green, blue), then it combines them for secondary colors(yellow, cyan, magenta), then it turns on all the colors to create white.

For best results, cover the LED with a piece of white paper to see the colors blend.

Circuit

Arduino Esplora Blink

Only your Arduino Esplora is needed for this example. Connect the Esplora to your computer with a USB cable.

Code

The RGB LED is comprised of three colors that represent the three primary colors: red, green, and blue.

To control all the colors with one instruction you use the writeRGB() function. It take three arguments. Each value represents the brightness of the red, green, and blue element, respectively. The brightness scales between 0 (for completely off) to 255 (for completely on).

After setting the brightness of an LED, use delay() to pause the sketch for a second, so the light stays in the state you left it.

It’s also possible to control each light individually with the following functions :

 

/*
Esplora Blink

This  sketch blinks the Esplora's RGB LED. It goes through
all three primary colors (red, green, blue), then it
combines them for secondary colors(yellow, cyan, magenta), then
it turns on all the colors for white.
For best results cover the LED with a piece of white paper to see the colors.

Created on 22 Dec 2012
by Tom Igoe

This example is in the public domain.
*/
Major Components in Project

Hardware Required

  • Arduino Esplora

For more detail: Arduino Esplora Code Clignotant


A Propos De L'Auteur

Ibrar Ayyub

Je suis expérimenté, rédacteur technique, titulaire d'une Maîtrise en informatique de BZU Multan, Pakistan à l'Université. Avec un arrière-plan couvrant diverses industries, notamment en matière de domotique et de l'ingénierie, j'ai perfectionné mes compétences dans la rédaction claire et concise du contenu. Compétent en tirant parti de l'infographie et des diagrammes, je m'efforce de simplifier des concepts complexes pour les lecteurs. Ma force réside dans une recherche approfondie et de présenter l'information de façon structurée et logique format.

Suivez-Nous:
LinkedinTwitter

Laisser un Commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

fr_FRFrench
Faire défiler vers le Haut