Beskrivelse
WS2812B 5050 RGB LED Strip 12V DC. Denne LED-strimmel er lavet af WS2812B LED’er, der er forbundet i serie. Disse LED’er har en IC indbygget, og en chip som tager 3 af gangen. Dette gør det muligt at kommunikere via en ledningsgrænseflade. Det betyder, at du kan dem ved hjælp af kun en digital pin på din Arduino, eller and form for board. Det er også muligt at klippe strimlen over og samle den med noget at de monterings vinkler vi har, dem kan du finde HER.
Tekniske detaljer:
Multicolor WS2812B LED strip
Width: 10mm
Pins: 3 (+, -, Signal)
LED Type: 5050 SMD
LED Quantity: 1M 60 / 5M 300 LED
Working Voltage: DC 12v
Watt: 18W/3.60A (1 Meter 60 LED)
FPC Color: Black
Available Color: Full color
IP Grade: Non-Waterproof
Operating Temperature: -20~+45 degree
Info: Tåler ikke vand
Forsyninger som passer til:
Info: Ved forsyning til 5 meter skal ampere være på 5A, eller virker controller og nogle LED diode ikke.
Controller som passer til:
Installere Arduino IDE Software
Før du kan starte din programmering skal Arduino’s IDE software hentes. Dette program bruges til at programmere chippen.
Download fra dette link: Download
Installere FastLED Library
- Download library (Download)
- Udpak filer
- Flyt/kopir mappen “esp8266-oled-ssd1306-master” til “libraries” som findes i “Arduino IDE” mappen (C:Program Files (x86)/Arduino/libraries)
- Åben Arduino IDE software og klik på “Sketch/Include library”
- Klik nu på “Add Zip. library” og find Zip filen du lige har downloaded.
- Åben “Sketch/Include library/Manage Librarys” for at opdatere library.
- Luk, og åben Arduino IDE programmet. (Genstart programmet)
- Nu er “esp8266-oled-ssd1306-master” installeret
Programmering
Inden programmeringen kan udføres skal den rigtige “COM” port findes. Klik “Værktøj/Port” – og vælg COM port.
Eksempel
Her viser vi et hurtig eksempel på hvordan du får LED stripsen til at vise forskellige farver.
Du skal bruge:
Forbind sådan:
- Arduino “GND” -> LED Strips “GND/Hvid”
- Arduino “Pin 5”-> LED Strips “D0/Grøn”
- Arduino “5V”-> LED Strips “5V/Rød”
Info: Der er i alt 5 ledninger, Rød, og hvid som ikke er i et stik er +/- 5V. De andre 3 ledninger “Rød=+5V”, “Hvis=GND” og “Grøn=Signal” som er i et stik, kan bruges til at forbinde andre WS2812B. Men fungere også som forsyning.
Kode
#include <FastLED.h> #define LED_PIN 3 #define NUM_LEDS 60 #define BRIGHTNESS 64 #define LED_TYPE WS2811 #define COLOR_ORDER GRB CRGB leds[NUM_LEDS]; #define UPDATES_PER_SECOND 100 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; } } 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()); } } 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 ); } 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 };
Download
Kontakt os
Du er altid velkommen til at kontakte os på info@ardustore.dk, eller sende os en besked via messenger (Klik her) og vi vil hjælpe dig.
Anmeldelser
Der er endnu ikke nogle anmeldelser.