Velleman VM207 Mode D'emploi page 12

Table des Matières

Publicité

delay(delayval); // Delay for a period of time (in milliseconds).
}
for(int i=0;i<NUMPIXELS;i++){
pixels.setPixelColor(i, pixels.Color(0,0,0)); // No color (dark).
}
pixels.show(); //Updating the panel to show nothing.
}
Ce code supprimera les valeurs après la boucle initiale 'for', en utilisant une seconde boucle 'for'. De plus, nous
avons changé la couleur de vert en bleu très saturé. Le niveau de luminosité est très élevé. Pour régler la lumi-
nosité du panneau complet, utilisez : pixels.setBrightness(20); cette fonction acceptera une valeur comprise
entre 0 (éteint) et 255 (luminosité max.). Pour voir l'effet sur l'afficheur, changez le code de la fonction 'loop'
(boucle):
void loop() {
pixels.setBrightness(20); // Setting the brightness really low.
// For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pix-
els minus one.
for(int i=0;i<NUMPIXELS;i++){
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
pixels.setPixelColor(i, pixels.Color(0,0,255)); // Bright blue color.
pixels.show(); // This sends the updated pixel color to the hardware.
delay(delayval); // Delay for a period of time (in milliseconds).
}
for(int i=0;i<NUMPIXELS;i++){
pixels.setPixelColor(i, pixels.Color(0,0,0)); // No color (dark).
}
pixels.show(); // Updating the panel to show nothing.
}
Voici maintenant le code complet : Il est conseillé de tester et d'expérimenter avant de continuer.
// NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
// Which pin on the Arduino is connected to the NeoPixels?
// On a Trinket or Gemma we suggest changing this to 1
#define PIN
MODE D'EMPLOI
K8403
6
12

Publicité

Table des Matières
loading

Table des Matières