Bibliothèque Neopixel D'adafruit - Velleman VM207 Mode D'emploi

Table des Matières

Publicité

Bibliothèque NeoPixel d'Adafruit
Tout d'abord, un petit mot sur la bibliothèque NeoPixel d'Adafruit. La bibliothèque créée par Adafruit, permet
de piloter individuellement une série de LEDs WS2812. Vous n'avez pas besoin de la bibliothèque pour afficher
des caractères ou des formes graphiques sur le panneau, mais peut parfois être utile pour piloter individuelle-
ment chaque LED.
Téléchargez la bibliothèque NeoPixel sur:
load ZIP)
Ensuite, installez la bibliothèque dans votre installation Arduino (placez le dossier téléchargé et décompressé
dans le dossier "Libraries" de l'installation Arduino) et lancez le logiciel Arduino.
Allez à : File > Examples > Adafruit Neopixel > simple. Arduino ouvre une fenêtre contenant le
sketch/croquis.
// 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
// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS
// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send sig-
nals.
// Note that for older NeoPixel strips you might need to change the third parameter--see the strand-
test
// example for more information on possible values.
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
Que se passe-t-il ?
Le sketch commence par l'inclusion de la bibliothèque Adafruit.
#define PIN 6 indique que la constante 'PIN' = 6 et définit la broche 6 comme broche de sortie numérique.
Pour changer la position de la broche (broche 13), ajustez la ligne de code comme suit : #define PIN 13
La ligne #define NUMPIXELS 16 indique le nombre de LEDs connectées. Pour contrôler 1 panneau, saisissez
la ligne comme suit : #define NUMPIXELS 64. Pour contrôler 2 panneaux, remplacez la valeur par 128, 3
panneaux = 192, etc.
MODE D'EMPLOI
K8403
https://github.com/adafruit/Adafruit_NeoPixel
6
16
(appuyez sur Down-
9

Publicité

Table des Matières
loading

Table des Matières