Wemos D1 examples
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
#include <Adafruit_NeoPixel.h>
|
||||
|
||||
#define PIN D2
|
||||
#define NUMPIXELS 1
|
||||
|
||||
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(9600);
|
||||
delay(250);
|
||||
Serial.println("PIXEL");
|
||||
|
||||
pixels.begin(); // This initializes the NeoPixel library.
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
pixels.setBrightness(20); //die Helligkeit setzen 0 dunkel -> 255 ganz hell
|
||||
pixels.setPixelColor(0, pixels.Color(255, 255, 255));
|
||||
pixels.show();
|
||||
delay(1000);
|
||||
|
||||
pixels.setBrightness(80); //die Helligkeit setzen 0 dunkel -> 255 ganz hell
|
||||
pixels.setPixelColor(0, pixels.Color(255, 255, 255));
|
||||
pixels.show();
|
||||
delay(1000);
|
||||
|
||||
pixels.setPixelColor(0, pixels.Color(226, 0, 200));
|
||||
for (int i = 1; i <= 250; i++) {
|
||||
pixels.setBrightness(i);
|
||||
pixels.show();
|
||||
delay(20);
|
||||
}
|
||||
|
||||
pixels.setBrightness(20);
|
||||
for (int hsv = 0; hsv < 65535; hsv++) {
|
||||
pixels.setPixelColor(0, pixels.gamma32(pixels.ColorHSV(hsv)));
|
||||
pixels.show();
|
||||
delay(1);
|
||||
}
|
||||
|
||||
|
||||
// // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
|
||||
// for (int i = 0; i < 2; i++) {
|
||||
// for (int j = 0; j < 2; j++) {
|
||||
// for (int k = 0; k < 2; k++) {
|
||||
// pixels.setPixelColor(0, pixels.Color(i * 255, j * 255, k * 255)); // Moderately bright green color.
|
||||
// pixels.show(); // This sends the updated pixel color to the hardware.
|
||||
// delay(200); // Delay for a period of time (in milliseconds).
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
Reference in New Issue
Block a user