New to the group and wanted to introduce myself and maybe ask for some

New to the group and wanted to introduce myself and maybe ask for some help.
I’m trying to setup my neopixels to react to sound. I have the hardware setup using a MSGEQ7 to break the sound up into 7 different channels. The neopixels I have are the WS2812 and one of the patterns I would like to have is something like a vu Meter. starting on the left end for the bass and ending at the right end with treble. I would like to have each frequency channel display on say 7 neo-pixels (I would like this adjustable in case I want to add neo-pixels) and then where one channel stops the next channel begins . When there is no sound I would like to have no neo-pixels lit but as the volume of each frequency increases the neo-pixels in each channel light up one by one from left to right pulsing with the sound and also maybe having a single pixel for each channel that is the end pixel for that frequency and as the neo-pixels are bouncing to the sound the last pixel be slower to move back down with the rest. I use to have this setup using the neo-pixel library (code written by a friend) but I would like to move up to the FastLED library. I started out using the MSGEQ7_FastLED example from the MSGEQ7 library and tried to move the code over from my previous sketch but because the previous sketch didn’t use the MSGEQ7 library I’m not sure what I need to move over, change or get rid of. This is just one pattern I would like. I would also like to have a few more patterns like one that will that have the neo-pixels lighting up from the middle outwards in both directions with different colors for the different frequencies. Any help would be really appreciated.

Hello @Mike_Smith and welcome! Here’s some code that does parts of what you’re looking for. See if you can get something like this working first before making it more complicated with the other stuff you’d like to do.

//Number of pixels filled is based on the analog value from the MSGEQ. That should be scaled to 0-255. Let’s call them V[0], V[1], etc.

uint8_t V[7]; //7 channels
#define BarLength 7 //number of pixels per channel

//clear all pixels each time around
fill_solid(leds, NUM_LEDS, CRGB::Black);

//loop each channel
for (int i = 0; i < 7; i++) {
leds[i + (i*BarLength)] = fill_solid(leds + (i*BarLength), map(V[i],0,255,0,BarLength), CRGB::Green);
}

If you would like to share your code please put it on http://gist.github.com and share the link. (G+ is not a good place to post more then just a few lines of code.)

@marmil Thank you for the help and quick response. I tried adding that little bit of code to the MSGEQ7_FastLED example sketch but I get and error when I try to verify it.

This line is higlighted

uint8_t V[7] = MSGEQ7.get(MSGEQ7_BASS); //7 channels

with this error:

error: array must be initialized with a brace-enclosed initializer

if I leave the MSGEQ7.get off of that line so it just reads:

uint8_t V[7];

Then I get an error on this line:

leds[i + (i*BarLength)] = fill_solid(leds + (i*BarLength), map(V[i],0,255,0,BarLength), CRGB::Green);

with this error:

error: no match for ‘operator+=’ (operand types are ‘CRGB’ and ‘void’)

Also I’m not sure how to “MSGEQ7.get” the average value of all 7 bands. In the git for the MSGEQ7 library, the documentation says to just leave off the “channel variable” , which I assume in the case of the line above is the “_BASS” so the line would look like this

uint8_t V[7] = MSGEQ7.get(MSGEQ7);

but it will not compile like that.

I apologize for probably what seems to be dumb questions about basic programming. I am new to programming and can barely fumble my way thru Arduino code to understand what it’s doing.

I do not know what MSGEQ7_FastLED example you are referring too. Please share a link to this code or put it on http://gist.github.com and share the link.

For my code snippets, the uint8_t V[7]; is meant to go somewhere at the top of your program where you create variables. It’s like line 60 in the code Tommy posted.
You have to grab each channel one at a time in a for loop (Example:
see lines 88-122 in code Tommy posted.)

@Tommy_Sciano Do I need to do anything else besides just uploading the sketch to the esp8266?

@Tommy_Sciano I also tried using the “ESP8266 Sketch Data Upload” and I get an error “SPIFFS Upload Failed”

I mean how are you powering and configuring the MSGEQ? Change that to your pins and then upload, also its a part of jason coons fastled webserver. so upload the sketch data

@Mike_Smith is the data folder inside of the sketch folder? as well as the correct board selected, same pins selected for your msgeq7 output as in the definitions for STRB RST and Audio?

@Tommy_Sciano I connected the MSGEQ7 to the esp8266 as per what pins were set in the sketch Strobe is D4, Reset is D5 analog input is A0 and Data to neopixels is D7. The data folder is in the sketch folder and I am using the Wemos D1 Mini and so I have that board selected. It does have a bunch of settings but I’m not exactly sure what the settings are supposed to be so I left it at the defaults. After I downloaded the zip from github and unpacked it when I tried to open the sketch It had me change the name of the folder to the name of the sketch…not sure if that would affect how it uploads

and the funny thing is, is that I can upload the sketch normally like any other sketch to the ESP8266 it’s only when I try to do the ESP8266 Sketch Data Upload that it fails.

@Tommy_Sciano well it appears that there was something on my Mac that was holding it up from uploading. shut down and rebooted and it uploaded fine. however now when I connect to the ESP8266 AP and navigate to 192.168.4.1 I get a “Not Found:/” as the page that comes up.

the webpage wont work unless you upload the sketch data
check the serial to see if it connects to the wifi you put in

@Mike_Smith could you send me your code and I can take a look at it?

Or if the code isn’t private, post to http://gist.github.com and share the link so others can learn something and/or help out. :slight_smile:

And I still don’t know what “MSGEQ7_FastLED” example you were originally referencing. Make it easier for others to help you out @Mike_Smith .

maybe you want to do it step by step. First get the MSGEQ7 working with an Arduino, then migrate to ESP.
And start with a simple sketch

@Tommy_Sciano actually I just used your code from github untouched but I actually got it to load. I didn’t realize that I needed to load the sketch separately from the sketch data. One thing I did notice tho is that there are quite a few patterns that the web interface tries to load but never fully gets loaded and so there are just a few neopixels that are red throughout the length of the neopixel strand and the web interface says loading pattern (**) please wait. Not sure if there is something wrong or if those ones are still a work in progress.