Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
682 B
2
Indexable
Never
#include <Adafruit_NeoPixel.h>

#define PIN        28 // The pin where the NeoPixel is connected
#define NUMPIXELS  1  // Number of pixels you are controlling

Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  pixels.begin(); // Initialize the NeoPixel library.
  pixels.setBrightness(5); // Set brightness (0-255)
}

void loop() {
  pixels.setPixelColor(0, pixels.Color(255, 0, 0)); // Red color
  pixels.show();
  delay(500);

  pixels.setPixelColor(0, pixels.Color(0, 255, 0)); // Green color
  pixels.show();
  delay(500);

  pixels.setPixelColor(0, pixels.Color(0, 0, 255)); // Blue color
  pixels.show();
  delay(500);
}
Leave a Comment