Hey Guys! I need some urgent help to hit a deadline on coming monday.

Hey Guys!

I need some urgent help to hit a deadline on coming monday. I am trying to have 4 seperate APA102 Stripes getting triggered by 4 buttons. Each button hit should shoot out a Pixel followed by a colorful trail on the corresponding LED strip. I am a bit lost right now and dont know how I can make it work at all. Especially to have multiple trails layered. I attached a video to show what I want to achieve. There is also some budget left. Appreciate any help or people who could program the whole thing!

http://vimeo.com/151601038

Can’t test because i’m having serial problems - but something like this? https://gist.github.com/focalintent/91c7a5b485f8723f7277

will test later!

I tested with 32 pixels and only 1 arm, but it only works after you add a FastLED.show();
I was wondering why it was just sitting there staring back at me, hehehe.

I added the FastLED.show(); line just inside the closing bracket of the main void loop.
Hope we get to see some video of this creation when it’s done. :slight_smile:

Ah! I figured I was forgetting something - that’s what happens when I just write out code and don’t try to run it :slight_smile:

Ok - fixed the gist, thanks @marmil

cool. just sitting down and connecting everything.

shit just killed my arduino :frowning: how do i avoid the arduino drawing to much power when its connected to PSU. whats the order of plugging/unplugging? i usually put in the PSU first and then USB(power for arduino) and then the LED Strip connector.

was working fine before and all the fastLED demo examples were running… shit :frowning:

question - where are you connecting the led strip power to? are you connecting it to the PSU or are you connecting it to one of the pins on the arduino, and which one? (You want to be careful if doing that - the 5v pin on the arduino can only sustain maybe an A or two of draw. I upgraded the gist here - https://gist.github.com/focalintent/91c7a5b485f8723f7277 - to limit FastLED’s total power draw to 1A, which should help at least while you’re testing.

Also - make sure you don’t have any short circuits set up anywhere - that can also make things go pretty sideways. (Sometimes, as a sanity check, before I plug any power in I’ll do a continuity test between the 5v and gnd lines - if I get the beep - there’s a short somewhere!)

Oh ouch. Did you kill the whole arduino or just some of the output pins?
Can you give a detailed description (drawings? pics?) of how you have everything, including the buttons, wired up? What sort of power supply are you using? Do you have a large capacitors on each led strip?

When it was working before were you lighting 400 pixels up? Reading button input?

Hey. I was powering it from an external 200W 5V PSU. No capacitors. Although I think that i killed it when plugging out the PSU, then the Arduino was trying to draw all the power (it defnitely killed a component, saw it smoking up (see picture). Good call with shot circuit testing. I just wired up one LED strip and wanted to test a simple library. Before it was working with just one LED strip and the DemoReel Example.

I have been told that I need to run that on a teensy. Got one now for the final Version (and borrowed another arduino for testing purposes) - Do I need to keep anything in mind when using a teensy? Whats the best way to implement the button pressed function? Can you guys help me out with that too? That would be ace!

(Also - this is why I tend to order my MCU’s in packs of 2-6 and constantly have spares around :slight_smile:

Makes sense haha. I added some more infos in the previous comment. Really appreciate your help. I need to start soldering everything together on the weekend. Can you check if my wiring up works like that? What else do I need? Capacitors?

From what you marked on the photo as having blown up, yeah, it sounds like too much draw was the problem. I wonder if it’s possible to craft a circuit such that when there’s no power on the 5v line from the PSU, it cuts off the data/clock lines between the board and the leds - so you could cut power to the leds without them attempting to pull power from elsewhere… Sadly, that is outside of the realm of my electrical foo (I’m generally terrible about physical electronics :slight_smile:

As for the code to use buttons try this updated gist - https://gist.github.com/focalintent/91c7a5b485f8723f7277 - and grab the Bounce2 library (if you don’t already have it in the arduino install) from here - https://github.com/thomasfredericks/Bounce2

If you’re going to use a Teensy 3.x you’ll probably need to add a 74HCT245 level shifter since the APA102 wants a nice 5v data/clock signal. (At least that was my experience with a Teensy 3.0 and APA102 strip. Otherwise the pixels went all glitchy.)

I usually add a capacitor on the strip like this, and a resistor (200-470 ohm range) on the data line:

There’s lots to read about buttons and reading them, but for the most basic setup have a look here:
https://www.arduino.cc/en/Tutorial/Button

that? http://www.jaycar.com.au/Active-Components/Integrated-Circuits/Logic/74HC245-Octal-Bus-Transeiver-IC/p/ZC4870

@Daniel_Garcia Yeah! That’d be cool for now I will continue as I did before and connect the LED strip to the Arduino as last step.

Let me know if the updated code that i put up works for you

will test tonight. at work now. just have to make sure i wire everything together properly :slight_smile:

@marmil can you test it? i need to avoid going nuts with this project… :slight_smile: It’s gonna be a 5m high installation for Rainbow Serpent. Thanks for all you help guys!