I am working on a project for the Hackaday Sci-Fi contest. The deadline is only a few days away, so I’m really hoping I can write some software that operates my Vulcan Salute. The ESP8266 will use FastLED to drive 26 LEDs, send analogWrite() commands to the motor control board, and on another pin analogWrite() to a 12V boost converter with an enable input. I would like the user to be able to select the pattern and change the PWM going to the motor and the boost converter that controls the strip infinity LEDs.
At first, I tried using Blynk because it has a nice interface on the phone. My program would work with FastLED and with the sliders I added, but when I used the Menu widget to select patterns, it would always crash, with no reset cause listed on the serial monitor. So I looked at @Jason_Coon 's webserver code that uses Websockets, JQuery and Bootstrap. Those tools are way over my head, and I would have to study them for hours before I could customize his slick looking app. I’ve started to customize @Juergen_Bruegl 's webserver code, and I added 2 new sliders last night for controlling the infinity mirror portion of the project, but I’m having trouble with the sliders. What apps have other people been using with FastLED to control their ESP8266s? Has anyone been able to use the new Menu widget with Blynk to select FastLED patterns?
https://hackaday.io/project/19860-vulcan-salute
Cool project! You might take a look at the v1.1 branch of esp8266-fastled-webserver. It only takes a few lines of code in Arduino to add new controls like sliders. No changes are required to the web app. Search for twinkleSpeed, and just copy, paste, and modify to add/modify sliders: https://github.com/jasoncoon/esp8266-fastled-webserver/tree/v1.1
@Jason_Coon Thanks for the tip, I’ll give the 1.1 branch a try tonight.
I use Blynk on all of my WiFi projects and have not had any issues using the menu widget. How are you going about getting the data from the menu and using it in your code?
@Brian_Lewis
With my Blynk sketch,
I’m using the pattern selecting code like in the DemoReel100 example. Then I’m using the Blynk example to make the menu using a switch:BLYNK_WRITE(V1) { //LED Pattern menu
switch (param.asInt())
{
case 1: // Item 1
gCurrentPatternNumber = 0;
Serial.println(“Sinelon selected”);
break;
case 2: // Item 2
gCurrentPatternNumber = 1;
Serial.println(“juggle selected”);
break;
case 3: // Item 3
gCurrentPatternNumber = 2;
Serial.println(“BPM selected”);
break;
default:
Serial.println(“Unknown item selected”);
}
}
@Jason_Coon I spent some time last night copying and pasting the code to make more sliders in the 1.1 branch of esp8266-fastled-webserver. I was able to get the sliders to respond great. For those seeking to do the same, there are a few lines in the main .ino sketch, and a few lines in the “fields.h” header file that need to be copied. After I remembered to set my output pins using pinMode(), I was in business. To make it run the Vulcan Salute, I’ll need to do some 3.3 to 5v level shifting in its hardware. THANK YOU!