Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

Commit

Permalink
Merge pull request #265 from toblum/develop
Browse files Browse the repository at this point in the history
v 2.1.6
  • Loading branch information
toblum committed Nov 20, 2018
2 parents e19ec28 + ac5e873 commit 2bb2943
Show file tree
Hide file tree
Showing 10 changed files with 604 additions and 137 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "Arduino/McLighting/data/McLightingUI"]
path = Arduino/McLighting/data/McLightingUI
url = https://github.com/toblum/McLightingUI
[submodule "clients/web/McLightingUI"]
path = clients/web/McLightingUI
url = https://github.com/toblum/McLightingUI
60 changes: 29 additions & 31 deletions Arduino/McLighting/McLighting.ino
Original file line number Diff line number Diff line change
Expand Up @@ -64,32 +64,6 @@ WebSocketsServer webSocket = WebSocketsServer(81);
ESP8266HTTPUpdateServer httpUpdater;
#endif

#ifdef USE_NEOANIMATIONFX
// ***************************************************************************
// Load libraries / Instanciate NeoAnimationFX library
// ***************************************************************************
// https://github.com/debsahu/NeoAnimationFX
#include <NeoAnimationFX.h>
#define NEOMETHOD NeoPBBGRB800

NEOMETHOD neoStrip(NUMLEDS);
NeoAnimationFX<NEOMETHOD> strip(neoStrip);

// Uses Pin RX / GPIO3 (Only pin that is supported, due to hardware limitations)
// NEOMETHOD NeoPBBGRB800 uses GRB config 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEOMETHOD NeoPBBGRB400 uses GRB config 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEOMETHOD NeoPBBRGB800 uses RGB config 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEOMETHOD NeoPBBRGB400 uses RGB config 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)

// Uses Pin D4 / GPIO2 (Only pin that is supported, due to hardware limitations)
// NEOMETHOD NeoPBBGRBU800 uses GRB config 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEOMETHOD NeoPBBGRBU400 uses GRB config 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEOMETHOD NeoPBBRGBU800 uses RGB config 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEOMETHOD NeoPBBRGBU400 uses RGB config 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)

#endif

#ifdef USE_WS2812FX
// ***************************************************************************
// Load libraries / Instanciate WS2812FX library
// ***************************************************************************
Expand All @@ -109,6 +83,23 @@ WS2812FX strip = WS2812FX(NUMLEDS, PIN, NEO_GRB + NEO_KHZ800);
// pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input
// and minimize distance between Arduino and first pixel. Avoid connecting
// on a live circuit...if you must, connect GND first.

#ifdef USE_WS2812FX_DMA
#include <NeoPixelBus.h>
NeoEsp8266Dma800KbpsMethod dma = NeoEsp8266Dma800KbpsMethod(NUMLEDS, 3); //800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
//NeoEsp8266Dma400KbpsMethod dma = NeoEsp8266Dma400KbpsMethod(NUMLEDS, 3); //400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
#endif
#ifdef USE_WS2812FX_UART
#include <NeoPixelBus.h>
NeoEsp8266Uart800KbpsMethod dma = NeoEsp8266Uart800KbpsMethod(NUMLEDS, 3);
#endif
#if defined(USE_WS2812FX_DMA) or defined(USE_WS2812FX_UART)
void DMA_Show(void) {
if(dma.IsReadyToUpdate()) {
memcpy(dma.getPixels(), strip.getPixels(), dma.getPixelsSize());
dma.Update();
}
}
#endif

// ***************************************************************************
Expand Down Expand Up @@ -265,6 +256,10 @@ void setup() {
// Setup: Neopixel
// ***************************************************************************
strip.init();
#if defined(USE_WS2812FX_DMA) or defined(USE_WS2812FX_UART)
dma.Initialize();
strip.setCustomShow(DMA_Show);
#endif
strip.setBrightness(brightness);
strip.setSpeed(convertSpeed(ws2812fx_speed));
//strip.setMode(FX_MODE_RAINBOW_CYCLE);
Expand Down Expand Up @@ -511,12 +506,15 @@ void setup() {
json["core_version"] = ESP.getCoreVersion();
json["cpu_freq"] = ESP.getCpuFreqMHz();
json["chip_id"] = ESP.getFlashChipId();
#ifndef USE_NEOANIMATIONFX
json["animation_lib"] = "WS2812FX";
json["pin"] = PIN;
#if defined(USE_WS2812FX_DMA)
json["animation_lib"] = "WS2812FX_DMA";
json["pin"] = 3;
#elif defined(USE_WS2812FX_UART)
json["animation_lib"] = "WS2812FX_UART";
json["pin"] = 2;
#else
json["animation_lib"] = "NeoAnimationFX";
json["pin"] = "Ignored, check NEOMETHOD";
json["animation_lib"] = "WS2812FX";
json["pin"] = PIN;
#endif
json["number_leds"] = NUMLEDS;
#ifdef ENABLE_BUTTON
Expand Down
Loading

0 comments on commit 2bb2943

Please sign in to comment.