Hey guys I've been working on a costume for my daughter for the last

Hey guys I’ve been working on a costume for my daughter for the last few weeks. Tried to learn Arduino and FastLED as quick as I could. I managed to piece together a lot of examples I found here and various places on the web. I have to pots in the ears for brightness and controlling various variables in some of the effects or changing hue. I have a microphone in the front of the ear for the sound reactive functions and a button in the back to change through modes. One thing about the button, if the LEDs are on full bright the button doesn’t work many times. I’ve checked the serial monitor and I do get a drop from 1020’s to 900’s and adjusted the code accordingly but still that issue. If anyone can help with that or has some cool code to share for me to add to it that’d be awesome! We are going to Disneyland Friday night all dressed as stick people. I’ll just have a simple dumb RGB suit on, no time for another fancy arduino one.

Here is the code. It’s not pretty and there is some junk to clean up but you get the idea. https://www.dropbox.com/s/vp5bbth6ynm3qx8/Minnie_Mouse.ino?dl=0
http://www.youtube.com/watch?v=mlD7Y8l6GeA

Oh and special thanks to @Jon_Burroughs for helping me with one of the sound sketches.

Looks great!

Anyone have advice on the button issue?

General advice on the button issue:

I had some routines that didn’t work well with the button as they had nested ‘for’ loops and went through a complex series of steps/loops before being returned back to loop() where the button was polled. Not good at all!

So, have a look at each sequence and make sure it quickly calculates stuff and returns to the loop().

An example of this problem is your fade in/fade out code at line 221.

Thanks Andrew. So it’s most likely that and not the code for the button itself that is the problem?

Well, I haven’t checked your button code (call me lazy), but I’d start there. Also, in my own setup, I put a capacitor across the button (on a digital port), and use an internal pullup resistor on the Arduino to help debounce it.

Interesting. I was thinking about using a capacitor across it and hadn’t seen anyone else do it. Here’s a video of her in it. https://www.dropbox.com/s/lzpalzy93wcy904/2014-10-17%2007.04.17.mov?dl=0

@Royce_H Use this library instead: https://github.com/mathertel/OneButton

And, I have always put my switch on a digital input not analog and used the internal pullups on the Arduino.

Thanks guys. It went great. I still have a lot to add. I’m going to use the ears by themselves for future visits. I’ve taken apart their glow with the show ears to tap into the LED’s so I can reproduce the colors on the WS2812b strips with neat effects.

Awesome! Hope you sorted out your button issues.

Andrew I was able to make it work 80% of the time. I put the call to checkinput() inside a few of the functions that wouldn’t change and it helped. Still a lot of work to do. One other strange thing is that I get totally different values when usb is plugged in. It shares the ground with the external supply. I’ve got a 12v li-ion battery with a 5v regulator. Also when I use serial monitor it changes the values of the mic and pots.