thehookup / Holiday_LEDs_2.0

Tested and 100% working, this new version is easier to setup and can support 6 zones dynamically
199 stars 36 forks source link

Allow for custom ESP pin definition. #6

Closed dpackham closed 5 years ago

dpackham commented 5 years ago

I am using a Wemos D1 Mini and needed to change your default 5 to 2 for my board. its not a big deal but if someone watching needs to do so they have to leave the "user config section" which makes updated much harder

thehookup commented 5 years ago

I can put this in, let me think about the best way to implement it. Leaving this issue open to remind me.

dpackham commented 5 years ago

Wow. wrong click there. re-opened

Misak commented 5 years ago

Hi, probably stupid question, but what do you mean by "default 5 to 2"? I've just uploaded code to D1 mini (1 zone, 1 strip 150leds ws2812b). Except below error, upload went well, but ping to the board has more than 95% packet loss, so I have no chance to try the code. Any reason for that packet loss?

In file included from /home/misak/arduino-1.8.7/Holiday_LEDs_2.0/Holiday_LED_2.0_6_Zones/Holiday_LED_2.0_6_Zones.ino:7:0:
/home/misak/arduino-1.8.7/portable/sketchbook/libraries/FastLED-master/FastLED.h:14:21: note: #pragma message: FastLED version 3.002.001
 #    pragma message "FastLED version 3.002.001"
                     ^
In file included from /home/misak/arduino-1.8.7/portable/sketchbook/libraries/FastLED-master/FastLED.h:65:0,
                 from /home/misak/arduino-1.8.7/Holiday_LEDs_2.0/Holiday_LED_2.0_6_Zones/Holiday_LED_2.0_6_Zones.ino:7:
/home/misak/arduino-1.8.7/portable/sketchbook/libraries/FastLED-master/fastspi.h:110:23: note: #pragma message: No hardware SPI pins defined.  All SPI access will default to bitbanged output
 #      pragma message "No hardware SPI pins defined.  All SPI access will default to bitbanged output"

No idea if this is causing it. Great work btw, thanks :)

thehookup commented 5 years ago

That's not an error, just an FYI message that the compiler is using bitbanged output (which is fine).

As far as the packet loss, there's nothing in the code that would cause that. ESP8266's either have enough resources and cycles to run wifi, or they don't. There's not really an in between. Can you try moving the board closer to the router to see if the packet loss decreases?

dpackham commented 5 years ago

I have both a Wemos D1 mini and a NodeMCU 1. the Wemos is the one installed on the roof and the signal pin is D4 which is reall GPIO2 and not the default GPIO5 like it is set to in the default code.

See below where I change the default of 5 to a 2

#if ZONEONE == 1 CRGB firstZone[FIRSTZONE_LEDS]; const int Pin_firstZone = 2; //marked as D1 on the board

thehookup commented 5 years ago

Closing this, if custom pins need to be assigned they can be changed in the following lines:

const int Pin_firstZone = 5; //marked as D1 on the board const int Pin_secondZone... etc