KUONGSHUN ELECTRONIC
Published

Light Up Suit Using WS2812B LEDs

Sew a WS2812B SMD LED strip onto your clothes. The control board uses Arduino UNO R3 and Mega 2560.

EasyFull instructions provided6 hours168
Light Up Suit Using WS2812B LEDs

Things used in this project

Hardware components

UNO R3 Board Atmega328P
×1
Mega 2560 R3 ATMEGA2560
×1
WS2812B SMD LED Strip 60 LED
×1
9V 2A battery
×1

Hand tools and fabrication machines

Soldering Tool

Story

Read more

Code

Upper body control

C/C++
#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel *pixels;// Define new pointer
uint8_t colorOrder = 0x52; //or just use NEO_GBR
#define PIN 3
int numPixel = 455;
Adafruit_NeoPixel strip = Adafruit_NeoPixel(numPixel, PIN, NEO_GRB + NEO_KHZ800);


int delayval = 50; // Delay time: 500ms

void setup() {

  pixels = new Adafruit_NeoPixel(numPixel, PIN, colorOrder);
  pixels->begin(); // initialize NeoPixel library.
  strip.begin();
  strip.setBrightness(35);
  strip.show(); // Initialize all pixels to 'off'
//  pinMode(A3,OUTPUT);
//  analogWrite(A3,255);
}

void loop() {

 
   rainbow1(2);//jacket
  delay(18000);//***Mode 1, delay 18 seconds
   rainbow2(2);
  delay(4000);//***Mode 2, delay 4 seconds
   rainbow3(2);
  delay(1000);//***Mode 3, delay 1 second
   rainbow4(2);
  delay(1000);
   rainbow5(2);
  delay(2000);
   rainbow6(2);
  delay(2500);
   rainbow7(2);
  delay(500);
   rainbow8(2);
  delay(2000);
   rainbow9(2);
  delay(2000);
   rainbow10(2);
  delay(1000);
   rainbow11(2);
  delay(2000);
  Extinguished(2);
  delay(4000);
   rainbow13(2);
  delay(4000);
  Extinguished(2);
  delay(3000);
   rainbow15(2);
  delay(10000);
  Extinguished(2);
  delay(2000);
   rainbow17(2);
  delay(29000);
   rainbow18(2);
  delay(2000);
   rainbow19(2);
  delay(1000);
   rainbow20(2);
  delay(2000);
  Extinguished(2);
  delay(3000);
   rainbow22(2);
  delay(2000);
   rainbow23(2);
  delay(6000);
   rainbow24(2);
  delay(8000); //***Mode 24
  theaterChaseRainbow(2);
   delay(8000);
}



void rainbow1(uint8_t wait) {//***Mode 1
    for(i=0; i<42; i++) {
      strip.setPixelColor(i,0,0,255);
    }
     for(j=43; j<78; j++) {
      strip.setPixelColor(j,255,255,255);//***Right glove
    }  
    for(k=78; k<125; k++) {
      strip.setPixelColor(k,0,0,255);
    }
     for(h=125; h<211; h++){
      strip.setPixelColor(h,255,225,255);//***hat
    }
    for(q=211; q<259; q++) {
      strip.setPixelColor(q,0,0,255);
    }
    for(s=259; s<295; s++) {
      strip.setPixelColor(s,255,255,255);//***Left glove
    }  
     for(a=295; a<455; a++) {
      strip.setPixelColor(a,0,0,255);
    }
    strip.show();
    delay(wait);
}

void rainbow2(uint8_t wait) {//***Mode 2
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<42; i++) {
      strip.setPixelColor(i,0,255,0);
    }
     for(j=43; j<78; j++) {
      strip.setPixelColor(j,255,255,255);//***Right glove
    }  
    for(k=78; k<125; k++) {
      strip.setPixelColor(k,0,255,0);
    }
     for(h=125; h<211; h++){
      strip.setPixelColor(h,255,225,255);//***hat
    }
    for(q=211; q<259; q++) {
      strip.setPixelColor(q,0,255,0);
    }
    for(s=259; s<295; s++) {
      strip.setPixelColor(s,230,255,255);//***Left glove
    }  
     for(a=295; a<455; a++) {
      strip.setPixelColor(a,0,255,0);
    }
    strip.show();
    delay(wait);
}

void rainbow3(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<42; i++) {
      strip.setPixelColor(i,0,0,255);
    }
     for(j=43; j<78; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=78; k<125; k++) {
      strip.setPixelColor(k,0,0,255);
    }
     for(h=125; h<211; h++){
      strip.setPixelColor(h,0,0,255);
    }
    for(q=211; q<259; q++) {
      strip.setPixelColor(q,0,0,255);
    }
    for(s=259; s<295; s++) {
      strip.setPixelColor(s,255,255,255);
    }  
     for(a=295; a<455; a++) {
      strip.setPixelColor(a,0,0,255);
    }
    strip.show();
    delay(wait);
}

void rainbow4(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<42; i++) {
      strip.setPixelColor(i,0,0,0);
    }
     for(j=43; j<78; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=78; k<125; k++) {
      strip.setPixelColor(k,0,0,0);
    }
     for(h=125; h<211; h++){
      strip.setPixelColor(h,0,0,255);
    }
    for(q=211; q<259; q++) {
      strip.setPixelColor(q,0,0,0);
    }
    for(s=259; s<295; s++) {
      strip.setPixelColor(s,255,255,255);
    }  
     for(a=295; a<455; a++) {
      strip.setPixelColor(a,0,0,0);
    }
    strip.show();
    delay(wait);
}

void rainbow5(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<42; i++) {
      strip.setPixelColor(i,0,0,255);
    }
     for(j=43; j<78; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=78; k<125; k++) {
      strip.setPixelColor(k,0,0,255);
    }
     for(h=125; h<211; h++){
      strip.setPixelColor(h,255,255,255);
    }
    for(q=211; q<259; q++) {
      strip.setPixelColor(q,0,0,255);
    }
    for(s=259; s<295; s++) {
      strip.setPixelColor(s,255,255,255);
    }  
     for(a=295; a<455; a++) {
      strip.setPixelColor(a,0,0,255);
    }
    strip.show();
    delay(wait);
}

void rainbow6(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<42; i++) {
      strip.setPixelColor(i,138,43,236);
    }
     for(j=43; j<78; j++) {
      strip.setPixelColor(j,255,0,0);
    }  
    for(k=78; k<125; k++) {
      strip.setPixelColor(k,138,43,236);
    }
     for(h=125; h<211; h++){
      strip.setPixelColor(h,255,255,0);
    }
    for(q=211; q<259; q++) {
      strip.setPixelColor(q,138,43,236);
    }
    for(s=259; s<295; s++) {
      strip.setPixelColor(s,255,255,255);
    }  
     for(a=295; a<455; a++) {
      strip.setPixelColor(a,138,43,236);
    }
    strip.show();
    delay(wait);
}

void rainbow7(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<42; i++) {
      strip.setPixelColor(i,255,0,255);
    }
     for(j=43; j<78; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=78; k<125; k++) {
      strip.setPixelColor(k,255,0,255);
    }
     for(h=125; h<211; h++){
      strip.setPixelColor(h,255,255,0);
    }
    for(q=211; q<259; q++) {
      strip.setPixelColor(q,255,0,255);
    }
    for(s=259; s<295; s++) {
      strip.setPixelColor(s,255,255,255);
    }  
     for(a=295; a<455; a++) {
      strip.setPixelColor(a,255,0,255);
    }
    strip.show();
    delay(wait);
}

void rainbow8(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<42; i++) {
      strip.setPixelColor(i,255,255,0);
    }
     for(j=43; j<78; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=78; k<125; k++) {
      strip.setPixelColor(k,255,255,0);
    }
     for(h=125; h<211; h++){
      strip.setPixelColor(h,0,0,255);
    }
    for(q=211; q<259; q++) {
      strip.setPixelColor(q,255,255,0);
    }
    for(s=259; s<295; s++) {
      strip.setPixelColor(s,255,255,255);
    }  
     for(a=295; a<455; a++) {
      strip.setPixelColor(a,255,255,0);
    }
    strip.show();
    delay(wait);
}

void rainbow9(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<42; i++) {
      strip.setPixelColor(i,0,0,255);
    }
     for(j=43; j<78; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=78; k<125; k++) {
      strip.setPixelColor(k,0,0,255);
    }
     for(h=125; h<211; h++){
      strip.setPixelColor(h,255,255,0);
    }
    for(q=211; q<259; q++) {
      strip.setPixelColor(q,0,0,255);
    }
    for(s=259; s<295; s++) {
      strip.setPixelColor(s,255,255,255);
    }  
     for(a=295; a<455; a++) {
      strip.setPixelColor(a,0,0,255);
    }
    strip.show();
    delay(wait);
}

void rainbow10(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<42; i++) {
      strip.setPixelColor(i,0,255,0);
    }
     for(j=43; j<78; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=78; k<125; k++) {
      strip.setPixelColor(k,0,255,00);
    }
     for(h=125; h<211; h++){
      strip.setPixelColor(h,0,0,255);
    }
    for(q=211; q<259; q++) {
      strip.setPixelColor(q,0,255,0);
    }
    for(s=259; s<295; s++) {
      strip.setPixelColor(s,255,255,255);
    }  
     for(a=295; a<455; a++) {
      strip.setPixelColor(a,0,255,0);
    }
    strip.show();
    delay(wait);
}

void rainbow11(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<42; i++) {
      strip.setPixelColor(i,255,0,255);
    }
     for(j=43; j<78; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=78; k<125; k++) {
      strip.setPixelColor(k,255,0,255);
    }
     for(h=125; h<211; h++){
      strip.setPixelColor(h,255,255,0);
    }
    for(q=211; q<259; q++) {
      strip.setPixelColor(q,255,0,255);
    }
    for(s=259; s<295; s++) {
      strip.setPixelColor(s,255,255,255);
    }  
     for(a=295; a<455; a++) {
      strip.setPixelColor(a,255,0,255);
    }
    strip.show();
    delay(wait);
}

void  Extinguished(uint8_t wait) {
  uint16_t i;
    for(i=0; i<456; i++) {
      strip.setPixelColor(i,0,0,0);
    }
    strip.show();
    delay(wait);
}

void rainbow13(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<42; i++) {
      strip.setPixelColor(i,0,255,0);
    }
     for(j=43; j<78; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=78; k<125; k++) {
      strip.setPixelColor(k,0,255,0);
    }
     for(h=125; h<211; h++){
      strip.setPixelColor(h,0,0,255);
    }
    for(q=211; q<259; q++) {
      strip.setPixelColor(q,0,255,0);
    }
    for(s=259; s<295; s++) {
      strip.setPixelColor(s,255,255,255);
    }  
     for(a=295; a<455; a++) {
      strip.setPixelColor(a,0,255,0);
    }
    strip.show();
    delay(wait);
}

void rainbow15(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<42; i++) {
      strip.setPixelColor(i,0,0,255);
    }
     for(j=43; j<78; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=78; k<125; k++) {
      strip.setPixelColor(k,0,0,255);
    }
     for(h=125; h<211; h++){
      strip.setPixelColor(h,255,255,255);
    }
    for(q=211; q<259; q++) {
      strip.setPixelColor(q,0,0,255);
    }
    for(s=259; s<295; s++) {
      strip.setPixelColor(s,255,255,255);
    }  
     for(a=295; a<455; a++) {
      strip.setPixelColor(a,0,0,255);
    }
    strip.show();
    delay(wait);
}

void rainbow17(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<42; i++) {
      strip.setPixelColor(i,0,0,255);
    }
     for(j=43; j<78; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=78; k<125; k++) {
      strip.setPixelColor(k,0,0,255);
    }
     for(h=125; h<211; h++){
      strip.setPixelColor(h,255,255,0);
    }
    for(q=211; q<259; q++) {
      strip.setPixelColor(q,0,0,255);
    }
    for(s=259; s<295; s++) {
      strip.setPixelColor(s,255,255,255);
    }  
     for(a=295; a<455; a++) {
      strip.setPixelColor(a,0,0,255);
    }
    strip.show();
    delay(wait);
}

void rainbow18(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<42; i++) {
      strip.setPixelColor(i,255,255,0);
    }
     for(j=43; j<78; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=78; k<125; k++) {
      strip.setPixelColor(k,255,255,0);
    }
     for(h=125; h<211; h++){
      strip.setPixelColor(h,0,0,255);
    }
    for(q=211; q<259; q++) {
      strip.setPixelColor(q,255,255,0);
    }
    for(s=259; s<295; s++) {
      strip.setPixelColor(s,255,255,255);
    }  
     for(a=295; a<455; a++) {
      strip.setPixelColor(a,255,255,0);
    }
    strip.show();
    delay(wait);
}

void rainbow19(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<42; i++) {
      strip.setPixelColor(i,255,255,255);
    }
     for(j=43; j<78; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=78; k<125; k++) {
      strip.setPixelColor(k,255,255,255);
    }
     for(h=125; h<211; h++){
      strip.setPixelColor(h,0,0,255);
    }
    for(q=211; q<259; q++) {
      strip.setPixelColor(q,255,255,255);
    }
    for(s=259; s<295; s++) {
      strip.setPixelColor(s,255,255,255);
    }  
     for(a=295; a<455; a++) {
      strip.setPixelColor(a,255,255,255);
    }
    strip.show();
    delay(wait);
}

void rainbow20(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<42; i++) {
      strip.setPixelColor(i,0,255,0);
    }
     for(j=43; j<78; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=78; k<125; k++) {
      strip.setPixelColor(k,0,255,0);
    }
     for(h=125; h<211; h++){
      strip.setPixelColor(h,0,0,255);
    }
    for(q=211; q<259; q++) {
      strip.setPixelColor(q,0,255,0);
    }
    for(s=259; s<295; s++) {
      strip.setPixelColor(s,255,255,255);
    }  
     for(a=295; a<455; a++) {
      strip.setPixelColor(a,0,255,0);
    }
    strip.show();
    delay(wait);
}

void rainbow22(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<42; i++) {
      strip.setPixelColor(i,0,0,255);
    }
     for(j=43; j<78; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=78; k<125; k++) {
      strip.setPixelColor(k,0,0,255);
    }
     for(h=125; h<211; h++){
      strip.setPixelColor(h,0,0,255);
    }
    for(q=211; q<259; q++) {
      strip.setPixelColor(q,0,0,255);
    }
    for(s=259; s<295; s++) {
      strip.setPixelColor(s,255,255,255);
    }  
     for(a=295; a<455; a++) {
      strip.setPixelColor(a,0,0,255);
    }
    strip.show();
    delay(wait);
}

void rainbow23(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<42; i++) {
      strip.setPixelColor(i,0,0,255);
    }
     for(j=43; j<78; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=78; k<125; k++) {
      strip.setPixelColor(k,0,0,255);
    }
     for(h=125; h<211; h++){
      strip.setPixelColor(h,255,0,0);
    }
    for(q=211; q<259; q++) {
      strip.setPixelColor(q,0,0,255);
    }
    for(s=259; s<295; s++) {
      strip.setPixelColor(s,255,255,255);
    }  
     for(a=295; a<455; a++) {
      strip.setPixelColor(a,0,0,255);
    }
    strip.show();
    delay(wait);
}

void rainbow24(uint8_t wait) {//***Mode 24
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<42; i++) {
      strip.setPixelColor(i,255,255,255);
    }
     for(j=43; j<78; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=78; k<125; k++) {
      strip.setPixelColor(k,255,255,255);
    }
     for(h=125; h<211; h++){
      strip.setPixelColor(h,255,255,255);
    }
    for(q=211; q<259; q++) {
      strip.setPixelColor(q,255,255,255);
    }
    for(s=259; s<295; s++) {
      strip.setPixelColor(s,255,255,255);
    }  
     for(a=295; a<455; a++) {
      strip.setPixelColor(a,255,255,255);
    }
    strip.show();
    delay(wait);
}

void theaterChaseRainbow(uint8_t wait) {
  for (int j=0; j < 256; j++) {     // cycle all 256 colors in the wheel
    for (int q=0; q < 3; q++) {
      for (uint16_t i=0; i < 455; i=i+3) {
        strip.setPixelColor(i+q, Wheel( (i+j) % 255));    //turn every third pixel on
      }
      strip.show();

      delay(wait);

      for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
        strip.setPixelColor(i+q, 0);        //turn every third pixel off
      }
    }
  }
}




////Common delay function
uint32_t Wheel(byte WheelPos) {
  WheelPos = 255 - WheelPos;
  if(WheelPos < 85) {
    return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
  }
  if(WheelPos < 170) {
    WheelPos -= 85;
    return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
  }
  WheelPos -= 170;
  return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}

Lower body contorl

C/C++
#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel *pixels;// Define new pointer
uint8_t colorOrder = 0x52; //or just use NEO_GBR
#define PIN 3
int numPixel = 228;
Adafruit_NeoPixel strip = Adafruit_NeoPixel(numPixel, PIN, NEO_GRB + NEO_KHZ800);


int delayval = 50; // Delay time: 500ms

void setup() {

  pixels = new Adafruit_NeoPixel(numPixel, PIN, colorOrder);
  pixels->begin(); // initialize NeoPixel library.
  strip.begin();
  strip.setBrightness(50);
  strip.show(); // Initialize all pixels to 'off'
//  pinMode(A3,OUTPUT);
//  analogWrite(A3,255);
}

void loop() {

 
   rainbow1(2);
  delay(18000);//***Mode 1, delay 18 seconds
   rainbow2(2);
  delay(4000);//***Mode 2, delay 4 seconds
   rainbow3(2);
  delay(1000);//***Mode 3, delay 1 second
   rainbow4(2);
  delay(1000);
   rainbow5(2);
  delay(2000);
   rainbow6(2);
  delay(2500);
   rainbow7(2);
  delay(500);
   rainbow8(2);
  delay(2000);
   rainbow9(2);
  delay(2000);
   rainbow10(2);
  delay(1000);
   rainbow11(2);
  delay(2000);
  Extinguished(2);
  delay(4000);
   rainbow13(2);
  delay(4000);
  Extinguished(2);
  delay(3000);
   rainbow15(2);
  delay(10000);
  Extinguished(2);
  delay(2000);
   rainbow17(2);
  delay(29000);
   rainbow18(2);
  delay(2000);
   rainbow19(2);
  delay(1000);
   rainbow20(2);
  delay(2000);
  Extinguished(2);
  delay(3000);
   rainbow22(2);
  delay(2000);
   rainbow23(2);
  delay(6000);
   rainbow24(2);
  delay(8000);//***Mode 24, delay 8 seconds
}



void rainbow1(uint8_t wait) {//***Mode 1
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<47; i++) {
      strip.setPixelColor(i,255,200,0);
    }
     for(j=47; j<81; j++) {
      strip.setPixelColor(j,255,255,255);//***right shoes
    }  
    for(k=81; k<148; k++) {
      strip.setPixelColor(k,255,200,0);
    }
     for(h=148; h<182; h++){
      strip.setPixelColor(h,255,225,255);//***left shoes
    }
    for(q=182; q<228; q++) {
      strip.setPixelColor(q,255,200,0);
    }
    strip.show();
    delay(wait);
}

void rainbow2(uint8_t wait) {//***Mode 2
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<47; i++) {
      strip.setPixelColor(i,255,200,0);
    }
     for(j=47; j<81; j++) {
      strip.setPixelColor(j,255,255,255);//***right shoes
    }  
    for(k=81; k<148; k++) {
      strip.setPixelColor(k,255,200,0);
    }
     for(h=148; h<182; h++){
      strip.setPixelColor(h,255,225,255);//***left shoes
    for(q=182; q<228; q++) {
      strip.setPixelColor(q,255,200,0);
    }
    strip.show();
    delay(wait);
}

void rainbow3(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<47; i++) {
      strip.setPixelColor(i,255,200,0);
    }
     for(j=47; j<81; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=81; k<148; k++) {
      strip.setPixelColor(k,255,200,0);
    }
     for(h=148; h<182; h++){
      strip.setPixelColor(h,255,225,255);
    }
    for(q=182; q<228; q++) {
      strip.setPixelColor(q,255,200,0);
    }
    strip.show();
    delay(wait);
}

void rainbow4(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<47; i++) {
      strip.setPixelColor(i,255,255,0);
    }
     for(j=47; j<81; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=81; k<148; k++) {
      strip.setPixelColor(k,255,255,0);
    }
     for(h=148; h<182; h++){
      strip.setPixelColor(h,255,225,255);
    }
    for(q=182; q<228; q++) {
      strip.setPixelColor(q,255,255,0);
    }
    strip.show();
    delay(wait);
}

void rainbow5(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<47; i++) {
      strip.setPixelColor(i,255,255,0);
    }
     for(j=47; j<81; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=81; k<148; k++) {
      strip.setPixelColor(k,255,255,0);
    }
     for(h=148; h<182; h++){
      strip.setPixelColor(h,255,225,255);
    }
    for(q=182; q<228; q++) {
      strip.setPixelColor(q,255,255,0);
    }
    strip.show();
    delay(wait);
}

void rainbow6(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<47; i++) {
      strip.setPixelColor(i,255,255,0);
    }
     for(j=47; j<81; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=81; k<148; k++) {
      strip.setPixelColor(k,255,255,0);
    }
     for(h=148; h<182; h++){
      strip.setPixelColor(h,255,225,255);
    }
    for(q=182; q<228; q++) {
      strip.setPixelColor(q,255,255,0);
    }
    strip.show();
    delay(wait);
}

void rainbow7(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<47; i++) {
      strip.setPixelColor(i,255,255,0);
    }
     for(j=47; j<81; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=81; k<148; k++) {
      strip.setPixelColor(k,255,255,0);
    }
     for(h=148; h<182; h++){
      strip.setPixelColor(h,255,225,255);
    }
    for(q=182; q<228; q++) {
      strip.setPixelColor(q,255,255,0);
    }
    strip.show();
    delay(wait);
}

void rainbow8(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<47; i++) {
      strip.setPixelColor(i,255,255,0);
    }
     for(j=47; j<81; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=81; k<148; k++) {
      strip.setPixelColor(k,255,255,0);
    }
     for(h=148; h<182; h++){
      strip.setPixelColor(h,255,225,255);
    }
    for(q=182; q<228; q++) {
      strip.setPixelColor(q,255,255,0);
    }
    strip.show();
    delay(wait);
}

void rainbow9(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<47; i++) {
      strip.setPixelColor(i,255,255,0);
    }
     for(j=47; j<81; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=81; k<148; k++) {
      strip.setPixelColor(k,255,255,0);
    }
     for(h=148; h<182; h++){
      strip.setPixelColor(h,255,225,255);
    }
    for(q=182; q<228; q++) {
      strip.setPixelColor(q,255,255,0);
    }
    strip.show();
    delay(wait);
}

void rainbow10(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<47; i++) {
      strip.setPixelColor(i,255,255,0);
    }
     for(j=47; j<81; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=81; k<148; k++) {
      strip.setPixelColor(k,255,255,0);
    }
     for(h=148; h<182; h++){
      strip.setPixelColor(h,255,225,255);
    }
    for(q=182; q<228; q++) {
      strip.setPixelColor(q,255,255,0);
    }
    strip.show();
    delay(wait);
}

void rainbow11(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<47; i++) {
      strip.setPixelColor(i,255,255,0);
    }
     for(j=47; j<81; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=81; k<148; k++) {
      strip.setPixelColor(k,255,255,0);
    }
     for(h=148; h<182; h++){
      strip.setPixelColor(h,255,225,255);
    }
    for(q=182; q<228; q++) {
      strip.setPixelColor(q,255,255,0);
    }
    strip.show();
    delay(wait);
}

void  Extinguished(uint8_t wait) {
  uint16_t i;
    for(i=0; i<228; i++) {
      strip.setPixelColor(i,0,0,0);
    }
    strip.show();
    delay(wait);
}

void rainbow13(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<47; i++) {
      strip.setPixelColor(i,255,255,0);
    }
     for(j=47; j<81; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=81; k<148; k++) {
      strip.setPixelColor(k,255,255,0);
    }
     for(h=148; h<182; h++){
      strip.setPixelColor(h,255,225,255);
    }
    for(q=182; q<228; q++) {
      strip.setPixelColor(q,255,255,0);
    }
    strip.show();
    delay(wait);
}

void rainbow15(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<47; i++) {
      strip.setPixelColor(i,255,255,0);
    }
     for(j=47; j<81; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=81; k<148; k++) {
      strip.setPixelColor(k,255,255,0);
    }
     for(h=148; h<182; h++){
      strip.setPixelColor(h,255,225,255);
    }
    for(q=182; q<228; q++) {
      strip.setPixelColor(q,255,255,0);
    }
    strip.show();
    delay(wait);
}

void rainbow17(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<47; i++) {
      strip.setPixelColor(i,255,255,0);
    }
     for(j=47; j<81; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=81; k<148; k++) {
      strip.setPixelColor(k,255,255,0);
    }
     for(h=148; h<182; h++){
      strip.setPixelColor(h,255,225,255);
    }
    for(q=182; q<228; q++) {
      strip.setPixelColor(q,255,255,0);
    }
    strip.show();
    delay(wait);
}

void rainbow18(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<47; i++) {
      strip.setPixelColor(i,255,255,0);
    }
     for(j=47; j<81; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=81; k<148; k++) {
      strip.setPixelColor(k,255,255,0);
    }
     for(h=148; h<182; h++){
      strip.setPixelColor(h,255,225,255);
    }
    for(q=182; q<228; q++) {
      strip.setPixelColor(q,255,255,0);
    }
    strip.show();
    delay(wait);
}

void rainbow19(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<47; i++) {
      strip.setPixelColor(i,255,255,0);
    }
     for(j=47; j<81; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=81; k<148; k++) {
      strip.setPixelColor(k,255,255,0);
    }
     for(h=148; h<182; h++){
      strip.setPixelColor(h,255,225,255);
    }
    for(q=182; q<228; q++) {
      strip.setPixelColor(q,255,255,0);
    }
    strip.show();
    delay(wait);
}

void rainbow20(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<47; i++) {
      strip.setPixelColor(i,255,255,0);
    }
     for(j=47; j<81; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=81; k<148; k++) {
      strip.setPixelColor(k,255,255,0);
    }
     for(h=148; h<182; h++){
      strip.setPixelColor(h,255,225,255);
    }
    for(q=182; q<228; q++) {
      strip.setPixelColor(q,255,255,0);
    }
    strip.show();
    delay(wait);
}

void rainbow22(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<47; i++) {
      strip.setPixelColor(i,255,255,0);
    }
     for(j=47; j<81; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=81; k<148; k++) {
      strip.setPixelColor(k,255,255,0);
    }
     for(h=148; h<182; h++){
      strip.setPixelColor(h,255,225,255);
    }
    for(q=182; q<228; q++) {
      strip.setPixelColor(q,255,255,0);
    }
    strip.show();
    delay(wait);
}

void rainbow23(uint8_t wait) {
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<47; i++) {
      strip.setPixelColor(i,255,255,0);
    }
     for(j=47; j<81; j++) {
      strip.setPixelColor(j,255,255,255);
    }  
    for(k=81; k<148; k++) {
      strip.setPixelColor(k,255,255,0);
    }
     for(h=148; h<182; h++){
      strip.setPixelColor(h,255,225,255);
    }
    for(q=182; q<228; q++) {
      strip.setPixelColor(q,255,255,0);
    }
    strip.show();
    delay(wait);
}

void rainbow24(uint8_t wait) {//***Mode 24
  uint16_t i,j,k,h,q,s,a;
    for(i=0; i<47; i++) {
      strip.setPixelColor(i,255,255,0);
    }
     for(j=47; j<81; j++) {
      strip.setPixelColor(j,255,255,255);//***right shoes
    }  
    for(k=81; k<148; k++) {
      strip.setPixelColor(k,255,255,0);
    }
     for(h=148; h<182; h++){
      strip.setPixelColor(h,255,225,255);//***left shoes
    }
    for(q=182; q<228; q++) {
      strip.setPixelColor(q,255,255,0);
    }
    strip.show();
    delay(wait);
}

////Common delay function
uint32_t Wheel(byte WheelPos) {
  WheelPos = 255 - WheelPos;
  if(WheelPos < 85) {
    return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
  }
  if(WheelPos < 170) {
    WheelPos -= 85;
    return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
  }
  WheelPos -= 170;
  return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}

Credits

KUONGSHUN ELECTRONIC

KUONGSHUN ELECTRONIC

1 project • 0 followers
Kuongshun Electronic Company is committed to 3Dprinter, RaspberryPI, Arduino UNO and various kinds electronic components.

Comments