Let me start off by saying that I'm still getting my feet wet in the Arduino world but I've been picking things up quickly.
What I'm trying to accomplish is have a few step sensors made out of conductive fabric and Velostat act as a button. Once the button is triggered, I'd like for that to trigger random flashes from 100+ white LEDs mounted on a board. Stepping on another sensor will just run the script again. I want a lot of quick flashes as though you're being photographed.
I've done some research into how to achieve this but I'm only getting half of what I need most times, or the posts are from years ago. I would imagine there are some newer/better methods to do this since 2010, you know?
Could anyone direct me towards either a tutorial, source code, anything that would help me get a better understanding of how to randomize 100+ LED flashes from multiple Velostat step sensors?
The classic way to do this is to use some shift registers since the Arduino doesn't have enough I/O. If you are familiar with CPLDs then you could use one of these instead of the number of shift registers that you will need to accomplish this task.
A second way to do this, and probably more preferable and cheaper, is to use LEDs with controllers built inside such as those distributed by Sparkfun [https://www.sparkfun.com/products/11821]. In this way, just run the data and power lines to each of them. It is theorized that 593 of these LEDs can be daisy chained together. You could create some great things with this.
The buttons would probably just connect to the Arduino pins. You didn't mention how many buttons you are using so I don't know for certain.
I was looking to make about 15-20 step sensors so they're hard to miss. Shouldn't I be able to run multiple buttons to the same pin?
I'm going to do some research into the item you posted.
I think the main thing is finding a project with code I can look at to figure out how to set up the randomization of all the LEDs to run at the time the button is pushed.
I was looking to make about 15-20 step sensors so they're hard to miss. Shouldn't I be able to run multiple buttons to the same pin?
If you use a common pull-up resistor, yes. This creates a "wired or" circuit where one or more switches/sensors can pull-down a single input.
The one thing that might be a consideration is if one of the sensors gets "stuck on" or shorted your system will be continuously activated and you won't know which sensor is causing the problem without disconnecting them one at a time.
I think the main thing is finding a project with code I can look at to figure out how to set up the randomization of all the LEDs to run at the time the button is pushed.
Use an if-statement to take action when a button is pushed.
Set-up several variables where each bit in the variable represents one LED. Then as you bit-shift these variables out to your shift-registers, the appropriate LEDs will be switched-on. Then, randomizing is simply a matter of using the random() function.
I haven't done this 100 LEDs, but I've done it with two "strings" of 24 LEDs. My project is a "stereo" lighting effect, so I have 2 type long variables (which can hold 32-bits), with 24-bits representing 24 LEDs. With this arrangement I can use bitwise operators to manipulate and address each LED independently. These are sound-activated effects, and some of the effects/patterns are random, or "randomized" where a random pattern is loaded and then it's shifted or toggled, etc.
It would probably be best to start with one button and one shift register (typically 8 LEDs) before expanding to 100 LEDs. Or, simplify things a bit more by hooking-up some LEDs directly to Arduino ports (without the shift register complications) and randomly "fire" those ports. You can even start-out doing that under software control before adding the button(s).
Then once you get the basics working, build-up from there.