How to use a pixel RGB LED display screen?

By Kumantech | 07 July 2017 | 3 Comments
Components needed:
1. Kuman Arduino UNO board*1
2. Kuman WS01 RGB LED display screen*1
3. Jumper wire*1



Sample code 1:
#include <Adafruit_NeoPixel.h>

#define PIN 6

Adafruit_NeoPixel strip = Adafruit_NeoPixel(64, PIN, NEO_GRB + NEO_KHZ800);

const uint8_t heart[]={10,11,12,13,17,18,19,20,21,22,24,25,26,27,28,29,
                                30,31,33,34,35,36,37,38,42,43,44,45,51,52};

void setup()
{
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
}

void loop()
{
  theaterChase(strip.Color(127, 127, 127), 50); // White
  //theaterChase(strip.Color(127,   0,   0), 50); // Red
  //theaterChase(strip.Color(  0,   0, 127), 50); // Blue
}

void theaterChase(uint32_t c, uint8_t wait)
{
  for (int j=0; j<10; j++)
  {  //do 10 cycles of chasing
    for (int q=0; q < 3; q++)
    {
      for (int i=0; i < 30; i++)
      {
        strip.setPixelColor(heart[i], c);    //turn every third pixel on
      }
      strip.show();
     
      delay(wait);
     
      for (int i=0; i < 30; i++)
      {
        strip.setPixelColor(heart[i], 0);        //turn every third pixel off
      }
    }
  }
}

Sample Code 2:
#include <Adafruit_NeoPixel.h>

#define PIN 6

Adafruit_NeoPixel strip = Adafruit_NeoPixel(64, PIN, NEO_GRB + NEO_KHZ800);

const uint8_t chart[5][30]={{9,10,11,12,13,14,17,30,33,34,35,36,37,38,46,49,57,58,59,60,61,62},
                            {9,10,11,12,13,14,17,30,33,34,35,36,37,38,41,54,57,58,59,60,61,62},
                            {11,12,19,20,27,28,35,36,43,44,51,52,59,60,60,60,60,60,60,60,60,60}};

void setup()
{
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
}

void loop()
{
  theaterChase(strip.Color(5,0,0 ), 50); // White
 
}

void theaterChase(uint32_t c, uint8_t wait)
{
  for (int j=0; j<3; j++)
  {  //do 10 cycles of chasing
    for (int q=0; q < 30; q++)
    {
      for (int i=0; i < 22; i++)
      {
        strip.setPixelColor(chart[j][i], c);    //turn every third pixel on
      }
      strip.show();
     
      delay(wait);
     
      for (int i=0; i < 22; i++)
      {
        strip.setPixelColor(chart[j][i], 0);        //turn every third pixel off
      }
    }
  }
}


 
Reubenhet
January 29,2020 04:38
The New BUSINESS DESIGN Review Honestly, throughout most of high school and university, I was basically a mediocre essay writer. If you be worried about having the ability to complete assignments by way of a certain deadline, our writers can put you at
Melvinnap
January 13,2020 00:45
Words And Expressions To Avoid In Writing Books Lindsay Ellis's latest video essay is about Barthe's Death of the Author and the relevance it has to some modern texts, especially John Green's The Fault In Our Stars. Fortunately, as opposed to every oth
Melvinnap
December 20,2019 16:55
Stay Away From The Smog With Airwheel 2 Wheels Scooters Z3 Books Lindsay Ellis's latest video essay is about Barthe's Death of the Author and the relevance it has to some modern texts, especially John Green's The Fault In Our Stars. Our qualified essay
Leave a Reply
Your email address will not be published.Required fields are marked. *
Name *
Email *
Content
Popular blog
Categories