/*
This is Wokwi's NeoPixel Canvas.
====================================================================
The NeoPixel Canvas has some attributes, that are:
pixelate: "YourShape" (shows the pixel depending on the shape.);
rows : "RowAmount" (how many rows the canvas will have.);
cols : "ColAmount" (how many cols the canvas will have.);
====================================================================
The Neopixel Canvas has 3/4 pins, that are:
VSS (negative pin of the canvas.);
VDD (vcc pin of the canvas.);
DIN (data in, always show DIN's pin in the code.);
DOUT (data out, not reccomended to use.);
====================================================================
This is just an example, don't hope too much.
*/
#include <Adafruit_NeoPixel.h>
#define PIN 6
#define NUMPIXELS 256 // Adjust the number of pixels according to your NeoPixel Canvas
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
pixels.begin(); // Initialize the NeoPixel library
}
void loop() {
for(int i=0; i<NUMPIXELS; i++) {
pixels.setPixelColor(i, pixels.Color(150, 0, 0)); // Red color
pixels.show(); // Update the display
delay(1);
}
delay(10);
for(int i=0; i<NUMPIXELS; i++) {
pixels.setPixelColor(i, pixels.Color(0, 150, 0)); // Green color
pixels.show(); // Update the display
delay(1);
}
delay(10);
for(int i=0; i<NUMPIXELS; i++) {
pixels.setPixelColor(i, pixels.Color(0, 0, 150)); // Blue color
pixels.show(); // Update the display
delay(1);
}
delay(10);
for(int i=0; i<NUMPIXELS; i++) {
pixels.setPixelColor(i, pixels.Color(255, 188, 34)); // Yellow color
pixels.show(); // Update the display
delay(1);
}
delay(10);
for(int i=0; i<NUMPIXELS; i++) {
pixels.setPixelColor(i, pixels.Color(0, 0, 0)); // Black color
pixels.show(); // Update the display
delay(1);
}
delay(10);
}