Herunterladen Inhalt Inhalt Diese Seite drucken

Velleman 64-LED RGB-MATRIX Bedienungsanleitung Seite 12

Inhaltsverzeichnis

Werbung

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.
}
Dieser Code löscht alle Werte nach der ersten For-Loop-Funktion, durch eine zweite For-Loop-Funktion zu be-
nutzen. Wir haben auch die Farbe gewechselt nach Blau (völlig gesättigt). Dies ist eine sehr helle Farbe. Um die
Helligkeit des ganzen Panels zu ändern, können Sie Folgendes verwenden: pixels.setBrightness(20); Diese
Funktion akzeptiert einen Wert zwischen 20 und 255 (0 = min. Helligkeit, 255 = max. Helligkeit) . Vergewissern
Sie sich davon, wie das Display beeinflusst wird wenn Sie die Loop-Funktion ändern (Kicken Sie zwei Mal, um
auszuwählen und zu kopieren):
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.
}
Unten sehen Sie wie der vollständige Code im Moment aussieht. Bevor Sie weitergehen, experimentieren Sie
mit alles was Sie in diesem Kapitel gelernt haben. Klicken Sie zwei Mal, um auszuwählen und zu kopieren.
// 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
BEDIENUNGSANLEITUNG
K8403
12

Quicklinks ausblenden:

Werbung

Inhaltsverzeichnis
loading

Inhaltsverzeichnis