ડબલ્યુએસ 2812 બી: જાદુઈ આરજીબી એલઇડી સ્ટ્રીપ

ડબલ્યુએસ 2812 બી આરજીબી એલઇડી સ્ટ્રીપ

ચોક્કસ તમારે તમારા DIY પ્રોજેક્ટ્સમાં રંગનો સંપર્ક ઉમેરવાની જરૂર છે. આ માટે, ઘણા ઉત્પાદકો પ્રખ્યાતનો ઉપયોગ કરે છે ડબલ્યુએસ 2812 બી આરજીબી એલઇડી સ્ટ્રિપ્સ, જેની સાથે તમારા પ્રોજેક્ટ્સ માટે વૈવિધ્યસભર રંગ નિયંત્રણ અને તદ્દન આકર્ષક લાઇટિંગ ઇફેક્ટ્સ પ્રાપ્ત કરવી. અલબત્ત તે અર્ડિનો બોર્ડ્સ સાથે સંપૂર્ણપણે સુસંગત સ્ટ્રીપ્સ છે, તેથી જ્યારે તેમને એકીકૃત કરવાનો પ્રયાસ કરી રહ્યા હોય ત્યારે તમને કોઈ મુશ્કેલી નહીં થાય.

તમે તેમને શોધી શકો છો 1 મીટર લંબાઈ, ઉદાહરણ તરીકે, તેમ છતાં તેઓ પાસેના દરેક મીટર માટે એલઇડીની ઘનતાના પ્રકારને આધારે બદલાઇ શકે છે. ઉદાહરણ તરીકે, ત્યાં 30 એલઇડીથી 144 એલઈડી છે. જો કે, જો તમને કોઈ મોટી સપાટી મેળવવા માટે લાંબી લંબાઈની જરૂર હોય, તો તમારી પાસે બજારમાં અન્ય વિકલ્પો પણ છે જેમ કે આરજીબી એલઇડી પેનલ્સ અથવા તમે હંમેશાં ઘણી સ્ટ્રીપ્સનો ઉપયોગ કરી શકો છો ...

આ પટ્ટાઓ કરતાં વધુ કંઈ નથી એસેમ્બલ આરજીબી એલઇડીની શ્રેણી અને તેમને સ્ટ્રીપ્સમાં જૂથ બનાવવા માટે સામાન્ય સપોર્ટ પર માઉન્ટ થયેલ. પરંતુ તેનું ઓપરેશન અલગ આરજીબી એલઈડી જેવું જ છે.

ડબલ્યુએસ 2812 બી શું છે?

આરજીબી ડબલ્યુએસ 2812 બીએ એલઇડી સ્ટ્રીપને પ્રકાશિત કરી

ખરેખર ડબ્લ્યુએસ 2812 બી પોતે સ્ટ્રીપ નથી, પરંતુ દરેક કોષો અથવા નાની આરજીબી એલઇડી પ્લેટો જેમાં શામેલ છે. તેમને સ્ટ્રીપ અથવા પેનલના રૂપમાં જૂથબદ્ધ કરી શકાય છે, જેથી તમે તેમની સંખ્યા અને આકારની દ્રષ્ટિએ વિવિધ રૂપરેખાંકનો બનાવી શકો. સ્ટ્રીપ્સ જે બનાવે છે તે લવચીક સ્ટ્રિપ્સ હોય છે, પરંતુ તમે પીસીબી પેનલ્સ પર WS2812B પણ શોધી શકો છો જે તે નથી.

જો તમે ઇચ્છો, તો તમે ડિવાઇસીસ શોધી શકો છો ડબલ્યુએસ 2812 બી અલગથી તમારી જાતે જરૂરી આકાર બનાવવા માટે. ઉદાહરણ તરીકે, તેમાંના લગભગ 100 એકમોની કિંમત સામાન્ય રીતે 10 ડોલર કરતા થોડી વધારે હોય છે.

rgb દોરી સ્ટ્રીપ કટીંગ

તમારે એ પણ જાણવું જોઈએ કે તમે તેમને ફેંકી દીધો છે તમે તેમને કાપી શકો છો તમને જરૂર હોય ત્યાં કાતર સાથે, તેનો અર્થ એ નથી કે તેઓ કામ કરવાનું બંધ કરે છે. તેથી તમારી પાસે ફક્ત તમને જરૂરી RGB એલઇડી હોઈ શકે છે. હકીકતમાં, તેમાં કેટલાક નિશાનો છે (ત્રણ કોપર પેડ્સ) જે તમે કાપી શકો છો. જો તમે આ પેડ્સ કાપી નાખો છો, તો તમારી પાસે સ્ટ્રીપની એક તરફ ત્રણ ટ્રેક હશે અને બીજી બાજુ જો તમે બીજા ટુકડાઓનો ફરીથી ઉપયોગ કરવા માંગતા હો, તો તેમાં તમે સરળ જોડાણ માટે પિનને સોલ્ડર કરી શકો છો.

પિનઆઉટ અને ડેટાશીટ

એક સરળ કોષમાં ડબલ્યુએસ 2812 બી

તે એક ઇનપુટ અને આઉટપુટ સાથેનો સ્વતંત્ર WS2812B સેલ છે

તમારા વિશે વધુ માહિતી માટે આરજીબી એલઇડી સ્ટ્રીપ ડબલ્યુએસ 2812 બી તમે વાંચી શકો છો ડેટાશીટ દરેક ઉત્પાદક દ્વારા ઓફર કરવામાં આવે છે, ત્યાં તમે operatingપરેટિંગ રેન્જ અને મર્યાદાઓ જાણવા ઉપરાંત, તેનો યોગ્ય રીતે ઉપયોગ કેવી રીતે કરવો તે જાણવા માટે પરિમાણો અને તકનીકી લાક્ષણિકતાઓની તમામ વિગતોની સલાહ લઈ શકો છો.

આ માટે પીનઆઉટતે ક્યાં તો મોટી સમસ્યા નથી, આ સ્ટ્રીપ્સમાં એક સરળ જોડાણ છે જે તમે ખૂબ જ જ્ withoutાન વિના શરૂઆતથી માસ્ટર કરી શકો છો. ત્યાં ફક્ત ત્રણ જ ઉપલબ્ધ છે, તેમ છતાં દરેક ડબ્લ્યુએસ 2812 બી સેલમાં ખરેખર વધુ કનેક્શન્સ હોય છે ...

તમારે ખાલી કરવું જ જોઇએ જોડો દરેક પટ્ટી પર વીસીસી પિન કે જે સ્ટ્રિપને V વીમાં અર્ડુનોથી અથવા કોઈ અલગ વીજ પુરવઠો, જીએનડી ગ્રાઉન્ડ, અલબત્ત, અને ડીઆઈ જે બીજા છે જે સક્રિય કરવા માઇક્રોકન્ટ્રોલરના કોઈપણ આઉટપુટ પર જશે. સ્ટ્રીપ પર આરજીબી એલઇડી.

જો તમે જુઓ એક ડબલ્યુએસ 2812 બી સેલ તમે જોશો કે તેમાં ડેટા ઇન અથવા ડી ઇનપુટ છે, અને વીસીસી અને જીએનડી વીજ પુરવઠો છે. પછી તેમાં ત્રણ અન્ય આઉટપુટ હશે, તે સ્ટ્રીપના આગલા કોષ સાથે જોડાયેલા હશે, અને આગળના સેલમાં તેના આઉટપુટને આગળના ઇનપુટ સાથે કનેક્ટ કરવામાં આવશે અને તેથી આખી પટ્ટી પૂર્ણ ન થાય ત્યાં સુધી ...

તે ચોક્કસપણે છે ડીઆઈ અથવા ડેટા ઇનપુટ તે જે આરજીબી એલઇડીઓને રૂપરેખાંકિત કરવા માટે રસપ્રદ છે, અને તે જ ડેટા ડેટા આઉટ અથવા ડીઓ સાથે કનેક્ટ થશે જે તે જ માહિતીને સ્ટ્રીપની આગામી કડી પર લઈ જશે. અને તેથી તે આખી પટ્ટીમાં ફેલાય છે.

ડબલ્યુએસ 2812 બી આરજીબી એલઇડી સ્ટ્રીપ્સ ખરીદો

આરજીબી એલઇડી સ્ટ્રીપ રોલ

તમે કરી શકો છો ખૂબ notંચા ભાવે ખરીદી વિવિધ વિશિષ્ટ સ્ટોર્સમાં. તમારી પાસે એમેઝોનમાં પણ વિવિધ સ્વરૂપોમાં છે. કેટલાક ઉદાહરણો છે:

અર્ડુનો અને ડબ્લ્યુએસ 2812 બી સાથે પરીક્ષણ

Arduino UNO WS2812B સ્કીમા સાથે

જેમ તમે કલ્પના કરી શકો છો, ફક્ત ત્રણ પિનથી તે ખૂબ જ સરળ છે આર્ડુનો સાથે જોડાઓ જેમ તમે ઉપરના આકૃતિમાં જોઈ શકો છો. તમારે હમણાં જ 5 વી અને જી.એન.ડી. ને ડબલ્યુએસ 2812 બી સ્ટ્રીપ સાથે જોડવું પડશે, અને ડીઆઈ એ આરડિનો પર તમે ઇચ્છતા આઉટપુટ સાથે. યાદ રાખો કે જો તમે પિન બદલો છો તો તમારે સ્રોત કોડમાં પણ ફેરફાર કરવો આવશ્યક છે જેથી પ્રોગ્રામ યોગ્ય રીતે કાર્ય કરે.

પુસ્તકાલયનો ઉપયોગ કરવામાં આવ્યો છે ફાસ્ટ-એલઇડી માસ્ટર વસ્તુઓ સરળ બનાવવા અને આરજીબી એલઇડી ચલાવવા માટે સરળ કાર્યો મેળવવા માટે. તેને આર્ડિનો આઇડીઇમાં યોગ્ય રીતે ડાઉનલોડ કરવા અને એકીકૃત કરવા માટે, ફક્ત તે લિંકથી લાઇબ્રેરીને ડાઉનલોડ કરો, પછી ઝીપને અનઝિપ કરો અને અનઝીપ્ડ ડિરેક્ટરી અથવા ફોલ્ડરને ફાસ્ટલેડ તરીકે નામ આપો, અને તે ફોલ્ડરને જ્યાં તમારા ઇન્સ્ટોલેશનમાં આર્દુનો આઇડીઇ લાઇબ્રેરીઓ ઇન્સ્ટોલ કરેલી છે ત્યાં ખસેડો. પછી આર્દુનો IDE ફરીથી ખોલો અને તે તૈયાર થઈ જશે ...

આ માટે સ્કેચ કોડ, તે નીચેના કોડની જેમ એકદમ સરળ હોઈ શકે છે. જો તમે ક copyપિ અને પેસ્ટ કરવા માંગતા નથી, તો તમે તેને પહેલાથી જ આવેલા ઉદાહરણોમાં શોધી શકો છો. તેથી ફાઇલ> ઉદાહરણો> ફાસ્ટલેડ> કલરપેલેટ પર જાઓ.

પિન 14 ને ઉદાહરણથી 5 માં બદલવાનું યાદ રાખો જે મેં આકૃતિમાં વપરાયેલ છે. અથવા તમે પિન 14 થી કનેક્ટ થઈ શકો છો અને કોડમાં ફેરફાર કરવાનું ટાળી શકો છો. જેમ તમે પસંદ કરો છો.
#include <FastLED.h>

#define LED_PIN     5
#define NUM_LEDS    14
#define BRIGHTNESS  64
#define LED_TYPE    WS2811
#define COLOR_ORDER GRB
CRGB leds[NUM_LEDS];

#define UPDATES_PER_SECOND 100

// This example shows several ways to set up and use 'palettes' of colors
// with FastLED.
//
// These compact palettes provide an easy way to re-colorize your
// animation on the fly, quickly, easily, and with low overhead.
//
// USING palettes is MUCH simpler in practice than in theory, so first just
// run this sketch, and watch the pretty lights as you then read through
// the code.  Although this sketch has eight (or more) different color schemes,
// the entire sketch compiles down to about 6.5K on AVR.
//
// FastLED provides a few pre-configured color palettes, and makes it
// extremely easy to make up your own color schemes with palettes.
//
// Some notes on the more abstract 'theory and practice' of
// FastLED compact palettes are at the bottom of this file.



CRGBPalette16 currentPalette;
TBlendType    currentBlending;

extern CRGBPalette16 myRedWhiteBluePalette;
extern const TProgmemPalette16 myRedWhiteBluePalette_p PROGMEM;


void setup() {
    delay( 3000 ); // power-up safety delay
    FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
    FastLED.setBrightness(  BRIGHTNESS );
    
    currentPalette = RainbowColors_p;
    currentBlending = LINEARBLEND;
}


void loop()
{
    ChangePalettePeriodically();
    
    static uint8_t startIndex = 0;
    startIndex = startIndex + 1; /* motion speed */
    
    FillLEDsFromPaletteColors( startIndex);
    
    FastLED.show();
    FastLED.delay(1000 / UPDATES_PER_SECOND);
}

void FillLEDsFromPaletteColors( uint8_t colorIndex)
{
    uint8_t brightness = 255;
    
    for( int i = 0; i < NUM_LEDS; i++) {
        leds[i] = ColorFromPalette( currentPalette, colorIndex, brightness, currentBlending);
        colorIndex += 3;
    }
}


// There are several different palettes of colors demonstrated here.
//
// FastLED provides several 'preset' palettes: RainbowColors_p, RainbowStripeColors_p,
// OceanColors_p, CloudColors_p, LavaColors_p, ForestColors_p, and PartyColors_p.
//
// Additionally, you can manually define your own color palettes, or you can write
// code that creates color palettes on the fly.  All are shown here.

void ChangePalettePeriodically()
{
    uint8_t secondHand = (millis() / 1000) % 60;
    static uint8_t lastSecond = 99;
    
    if( lastSecond != secondHand) {
        lastSecond = secondHand;
        if( secondHand ==  0)  { currentPalette = RainbowColors_p;         currentBlending = LINEARBLEND; }
        if( secondHand == 10)  { currentPalette = RainbowStripeColors_p;   currentBlending = NOBLEND;  }
        if( secondHand == 15)  { currentPalette = RainbowStripeColors_p;   currentBlending = LINEARBLEND; }
        if( secondHand == 20)  { SetupPurpleAndGreenPalette();             currentBlending = LINEARBLEND; }
        if( secondHand == 25)  { SetupTotallyRandomPalette();              currentBlending = LINEARBLEND; }
        if( secondHand == 30)  { SetupBlackAndWhiteStripedPalette();       currentBlending = NOBLEND; }
        if( secondHand == 35)  { SetupBlackAndWhiteStripedPalette();       currentBlending = LINEARBLEND; }
        if( secondHand == 40)  { currentPalette = CloudColors_p;           currentBlending = LINEARBLEND; }
        if( secondHand == 45)  { currentPalette = PartyColors_p;           currentBlending = LINEARBLEND; }
        if( secondHand == 50)  { currentPalette = myRedWhiteBluePalette_p; currentBlending = NOBLEND;  }
        if( secondHand == 55)  { currentPalette = myRedWhiteBluePalette_p; currentBlending = LINEARBLEND; }
    }
}

// This function fills the palette with totally random colors.
void SetupTotallyRandomPalette()
{
    for( int i = 0; i < 16; i++) {
        currentPalette[i] = CHSV( random8(), 255, random8());
    }
}

// This function sets up a palette of black and white stripes,
// using code.  Since the palette is effectively an array of
// sixteen CRGB colors, the various fill_* functions can be used
// to set them up.
void SetupBlackAndWhiteStripedPalette()
{
    // 'black out' all 16 palette entries...
    fill_solid( currentPalette, 16, CRGB::Black);
    // and set every fourth one to white.
    currentPalette[0] = CRGB::White;
    currentPalette[4] = CRGB::White;
    currentPalette[8] = CRGB::White;
    currentPalette[12] = CRGB::White;
    
}

// This function sets up a palette of purple and green stripes.
void SetupPurpleAndGreenPalette()
{
    CRGB purple = CHSV( HUE_PURPLE, 255, 255);
    CRGB green  = CHSV( HUE_GREEN, 255, 255);
    CRGB black  = CRGB::Black;
    
    currentPalette = CRGBPalette16(
                                   green,  green,  black,  black,
                                   purple, purple, black,  black,
                                   green,  green,  black,  black,
                                   purple, purple, black,  black );
}


// This example shows how to set up a static color palette
// which is stored in PROGMEM (flash), which is almost always more
// plentiful than RAM.  A static PROGMEM palette like this
// takes up 64 bytes of flash.
const TProgmemPalette16 myRedWhiteBluePalette_p PROGMEM =
{
    CRGB::Red,
    CRGB::Gray, // 'white' is too bright compared to red and blue
    CRGB::Blue,
    CRGB::Black,
    
    CRGB::Red,
    CRGB::Gray,
    CRGB::Blue,
    CRGB::Black,
    
    CRGB::Red,
    CRGB::Red,
    CRGB::Gray,
    CRGB::Gray,
    CRGB::Blue,
    CRGB::Blue,
    CRGB::Black,
    CRGB::Black
};



// Additionl notes on FastLED compact palettes:
//
// Normally, in computer graphics, the palette (or "color lookup table")
// has 256 entries, each containing a specific 24-bit RGB color.  You can then
// index into the color palette using a simple 8-bit (one byte) value.
// A 256-entry color palette takes up 768 bytes of RAM, which on Arduino
// is quite possibly "too many" bytes.
//
// FastLED does offer traditional 256-element palettes, for setups that
// can afford the 768-byte cost in RAM.
//
// However, FastLED also offers a compact alternative.  FastLED offers
// palettes that store 16 distinct entries, but can be accessed AS IF
// they actually have 256 entries; this is accomplished by interpolating
// between the 16 explicit entries to create fifteen intermediate palette
// entries between each pair.
//
// So for example, if you set the first two explicit entries of a compact 
// palette to Green (0,255,0) and Blue (0,0,255), and then retrieved 
// the first sixteen entries from the virtual palette (of 256), you'd get
// Green, followed by a smooth gradient from green-to-blue, and then Blue.



ટિપ્પણી કરવા માટે સૌ પ્રથમ બનો

તમારી ટિપ્પણી મૂકો

તમારું ઇમેઇલ સરનામું પ્રકાશિત કરવામાં આવશે નહીં. આવશ્યક ક્ષેત્રો સાથે ચિહ્નિત થયેલ છે *

*

*

  1. ડેટા માટે જવાબદાર: મિગ્યુએલ gelંજેલ ગેટóન
  2. ડેટાનો હેતુ: નિયંત્રણ સ્પામ, ટિપ્પણી સંચાલન.
  3. કાયદો: તમારી સંમતિ
  4. ડેટાની વાતચીત: કાયદાકીય જવાબદારી સિવાય ડેટા તૃતીય પક્ષને આપવામાં આવશે નહીં.
  5. ડેટા સ્ટોરેજ: cસેન્ટસ નેટવર્ક્સ (ઇયુ) દ્વારા હોસ્ટ કરેલો ડેટાબેઝ
  6. અધિકાર: કોઈપણ સમયે તમે તમારી માહિતીને મર્યાદિત, પુન recoverપ્રાપ્ત અને કા deleteી શકો છો.