// LCD1602 to Arduino Uno connection example
#include <LiquidCrystal.h>
#include <Adafruit_NeoPixel.h>
#define nP 24 // Number of LEDs
Adafruit_NeoPixel Neopixels1 = Adafruit_NeoPixel(nP, 10, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel Neopixels2 = Adafruit_NeoPixel(nP, 9, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel Neopixels3 = Adafruit_NeoPixel(nP, 8, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel Neopixels4 = Adafruit_NeoPixel(nP, 7, NEO_GRB + NEO_KHZ800);
int i;
void clearLed()
{
Neopixels1.clear();
Neopixels1.show();
Neopixels2.clear();
Neopixels2.show();
Neopixels3.clear();
Neopixels3.show();
Neopixels4.clear();
Neopixels4.show();
}
void setup() {
Neopixels1.begin();
Neopixels2.begin();
Neopixels3.begin();
Neopixels4.begin();
clearLed();
}
void led1(int r , int g,int b)
{
for (i = 0; i < 16; i++)
{
Neopixels1.setPixelColor(i, r, g, b); //(pixel(R,G,B)
Neopixels1.show();
delay(100);
}
}
void led2(int r , int g,int b)
{
for (i = 0; i < 16; i++)
{
Neopixels2.setPixelColor(i, r, g, b); //(pixel(R,G,B)
Neopixels2.show();
delay(100);
}
}
void led3(int r , int g,int b)
{
for (i = 0; i < 16; i++)
{
Neopixels3.setPixelColor(i, r, g, b); //(pixel(R,G,B)
Neopixels3.show();
delay(100);
}
}
void led4(int r , int g,int b)
{
for (i = 0; i < 16; i++)
{
Neopixels4.setPixelColor(i, r, g, b); //(pixel(R,G,B)
Neopixels4.show();
delay(100);
}
}
void loop() {
led1(255,0,0);
led2(0,255,0);
led3(0,0,255);
led4(0,255,255);
clearLed();
}