Yup you can actually see that being used on the saturation slider… the issue im facing is that it overloads the poor little ESP and causes it to reset … go slow enough and it can handle 50 odd requests in a split second but after that is goes offline.
I chopped that part from the video lol
Here is the code if you can see anywhere to improve it? Im kinda just learning/googling my way through it.
Build options changed, rebuilding all
In file included from /Users/fsolanes/Documents/Arduino/newpost/newpost.ino:26:0:
/Users/fsolanes/Documents/Arduino/libraries/FastLED-master/FastLED.h:17:21: note: #pragma message: FastLED version 3.001.001
pragma message “FastLED version 3.001.001”
^
In file included from /Users/fsolanes/Documents/Arduino/libraries/FastLED-master/FastLED.h:65:0,
from /Users/fsolanes/Documents/Arduino/newpost/newpost.ino:26:
/Users/fsolanes/Documents/Arduino/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”
^
In file included from /Users/fsolanes/Documents/Arduino/newpost/newpost.ino:26:0:
/Users/fsolanes/Documents/Arduino/libraries/FastLED-master/FastLED.h: In static member function ‘static CLEDController& CFastLED::addLeds(CRGB*, int, int)’:
/Users/fsolanes/Documents/Arduino/libraries/FastLED-master/FastLED.h:404:14: error: ‘WS2813_PORTA’ was not declared in this scope
case WS2813_PORTA: return addLeds(new InlineBlockClocklessController<NUM_LANES, PORTA_FIRST_PIN, NS(320), NS(320), NS(640), RGB_ORDER, 0, false, 300>(), data, nLedsOrOffset, nLedsIfOffset);
^
exit status 1
Error compiling for board Adafruit HUZZAH ESP8266.
This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.
Here is the compile output from my end. Similar SPI/Bitbanging issue but its just a warning. It wil works fine.
In file included from D:\_UserData\My Documents\Arduino\ESP_Shelf_Blynk_FullOptions\ESP_Shelf_Blynk_FullOptions.ino:4:0:
D:\_UserData\My Documents\Arduino\libraries\FastLED-master/FastLED.h:17:21: note: #pragma message: FastLED version 3.001.001
# pragma message "FastLED version 3.001.001"
^
In file included from D:\_UserData\My Documents\Arduino\libraries\FastLED-master/FastLED.h:65:0,
from D:\_UserData\My Documents\Arduino\ESP_Shelf_Blynk_FullOptions\ESP_Shelf_Blynk_FullOptions.ino:4:
D:\_UserData\My Documents\Arduino\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"
^
Sketch uses 237,297 bytes (22%) of program storage space. Maximum is 1,044,464 bytes.
Global variables use 34,164 bytes (41%) of dynamic memory, leaving 47,756 bytes for local variables. Maximum is 81,920 bytes.
Uploading 241440 bytes from to flash at 0x00000000
............................................................................................................................................................................................................................................
I decided to create bunch of modular slave units that I can place around my house. Controlled by the same interface and code (albeit slightly modified for less LEDs) as previous posts
What logic level shifter did you use for your LED data signal? I’m trying something similar, but I’m having difficulty getting any sort of response out of my LEDs with a Wemos D1 R2 (3.3V DO).
I’ve verified the LEDs are performing correctly with an UNO.
I’ve verified D5 on the Wemos is the correct pin and matches with my code.
But, whenever I un-wire the LED and replace it with the WS2812B strip, I don’t even get a peep out of the LEDs. Also just for experimentation I tried without a resistor in the data signal line and also feeding the leds directly with the 3.3v signal, but neither worked.
Here is the code I’m trying to run:
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <FastLED.h>
#include <SimpleTimer.h>
// How many leds in your strip?
#define NUM_LEDS 70
#define DATA_PIN 14
CRGB leds[NUM_LEDS];
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "XXXXXXXXXX";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "XXXXXXXXXX";
char pass[] = "XXXXXXXXXX";
int varonoff;
int i = 0;
SimpleTimer timer;
void setup()
{
//Serial.begin(9600);
FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
Blynk.begin(auth, ssid, pass);
timer.setInterval(50L, chase);
timer.setInterval(1000L,senduptime);
}
void loop()
{
Blynk.run();
timer.run(); // Initiates SimpleTimer
}
void chase() {
leds[i - 3] = CHSV( 224, 255, 0);
leds[i - 2] = CHSV( 224, 255, 50);
leds[i - 1] = CHSV( 224, 255, 150);
leds[i] = CHSV( 224, 255, 255);
leds[i + 1] = CHSV( 224, 255, 150);
leds[i + 2] = CHSV( 224, 255, 50);
leds[i + 3] = CHSV( 224, 255, 0);
FastLED.show();
i++;
if (i == 70){
i = 0;
}
}
void senduptime(){
Blynk.virtualWrite(V20, millis() / 1000);
}
This code works on the UNO (modified of course to remove all of the blynk stuff) and I know the code is running on the Wemos, because the uptime is updating correctly on the app.
Wow! Okay so it works to an extent. I am getting LEDS to light and do what they are supposed to do most of the time. Only problem now is that the wemos disconnects (I’m assuming resets but haven’t check with serial monitor yet) from the app every 2-3 seconds causing long pauses in the LED “animation” I slightly updated the code and to avoid having another long post, I have edited the code in the previous post to reflect the changes.
Also, why did controlling an individual LED from D5 in the app work? Is it because the app re-maps for you or something like that?
Thanks again!
edit: I added some stuff to Serial.print and discovered it didn’t seem to like when “i +1” or +2 or +3 got bigger than 70 (number of leds) I edited the code so “i” never tried to write to an LED bigger than 70. Strangely the uno didn’t have a problem with this.
Time to add back in some of the other code to see if I can get this where I want it to be!
@Jon_Moore to be honest I don’t really know how the pin definitions work but this is what works for us:
In the IDE you obviously need to set the correct board.
In the app set your device as an ESP8266 not as a WeMos
In the sketch use regular ESP GPIO numbers.
This way your sketch will work on regular ESP’s and the WeMos.
Hook up Serial Monitor and debug with:
#define BLYNK_DEBUG // Optional, this enables lots of prints
#define BLYNK_PRINT Serial
Comment out the first line once you have fixed the problem as it can make your hardware run 10 times slower than it does without debug.
Try 50L at 500L and see if it works as expected. If it does keep reducing the 500L and retest. Can be done with a slider if you don’t want to keep changing your sketch.
Okay it still seems to stutter every once in a while but I had to modify the code again. it also didn’t like writing to the led “i-1” when “i” was 0 AND “varhue” was less than 105… It was very repeatable and it would set “i” to a value of several million immediately after this step…
Strangely enough it didn’t mind -2 or -3…
I can now control the hue with a slider and it works after another code modification!It does still stutter occasionally, but I think it’s workable for my project.
Thanks for your help Costas! If I need any further assistance (or want to show off my project) I’ll start a new post. Blynk+Arduino+Wemos is so much fun!