Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Change patterns with less than 1 second worth of button press?

I have a planned project for next year that I hope to set up with 2 blinkytape controllers that will run an identical pair of patterns. (Call it a double width strip.) I can remove the switches on the controllers and wire in a photo interrupter which is what I hope to use. Question is, can I make the patterns change with less than 1 second of switch engagement? The interrupt may only happen for a split second.

Comments

  • Are they showing exactly identical patterns? If so, you can probably simplify the setup by using a single controller, and connecting the data output from the single controller to the data input on both LED strips. For the button press, the easiest way to accomplish this is make a custom firmware for the BlinkyTape using Arduino. Here is a simplifed example that shows how to play a single pattern, and adjust the brightness at every button press: https://github.com/Blinkinlabs/BlinkyTape_Arduino/tree/master/examples/PatternPlayer The animation is defined in the file 'samplePattern.h', and you can use PatternPaint to create header files for your animations (choose File->'Export pattern for Arduino'). You can repeat this process for each of the animations you want to include, then copy them all into your Arduino project, and modify the sketch so that it changes the pattern each time the button is pressed. Happy to work through the different parts if you need some pointers.
  • Yep, they'll both be identical so it would be a help to only use one controller. I didn't realize you could export to Arduino, so that's another huge help! (I guess I need to read more, instead of nosediving into things..) The switch will be under a slot in a donation box in which coins and bills will be dropped, so sometimes the interrupt will only be a quick flash. Is the "1second" rule absolute, or can the controller be set to recognize more of a tap to the button? Thank you!
  • Ok, cool! The 1 second rule isn't required at all; it was intentional behavior so that a single button could do both brightness (quick press) and pattern change (press ~1 second). The above example is a simplified version of the one that we use in the normal firmware, that only implements the brightness adjustment. I suggest starting with that one since it's more straightforward than the version implemented in the regular firmware.
  • Excellent! I've still got a LOT to learn before this project is due so I'm going to finish up my Arduino programming book, (only on chapter 4 so far) then come back here to make sure the things in my head will work in the real world of BlinkyTape. :smiley:
  • edited December 2016
    I'll throw in the general idea of what I'm cooking up, and once I feel I've either figured out most of it, or reached a point where I know I won't, I'll re-visit this thread to ask for further assistance if that's okay with all of you. Or, if anyone reads this and can devise a better way of setting it up, I'll be all ears. Next year, I'm going to build a Christmas tree for our office. Our building houses 600+ employees so I needed an idea to catch attention. Enter BlinkyTape, Arduino Mega and friends. The tree by default will have a white theme, with wide white and silver ribbon, semi opaque and white ornaments, etc. It will also have 2 sets of lights. Standard white twinkle lights and 10 meters of ws2812b strips and 5 meters of simple RGB strip that will be attached along the back of the wide ribbon (this strip will be off in the default white mode). The blinkytape will run a simple white discoparty style flash/fade routine in this mode. I also need to find a way to have a default music mode that plays a playlist of Christmas music that matches this mode. I'm guessing the mega will handle this with a shield or two... The mega will be the brains behind the brains, and will have a donation box attached which will have an interrupt in the slot so that when something is dropped in, it will notify blinky to change to pattern 2, pause playlist 1 and play 1 rather upbeat Christmas song on a different playlist. Pattern 2 will obviously be very colorful and flashy. I think the trickiest part of this will be how to set the system back to mode 1 after the single song has completed. I'm thinking a timer on the mega can be utilized to set it back after the length of the song has passed... It will also have to ignore the donation box switch while in mode 2 so as not to mess up the song. Aaaannndddd... That's about all I've got right now. I'm probably in waay over my head, but I've got a year to figure it out so it should work out OK. Thanks! *Addendum* I have a set of Bright Tunes lights with 4 bluetooth speakers attached that I can use to play the mode 1 playlist. Stuff like White Christmas, Silver Bells, etc. Classical, soft Christmas music. Mode 2 would use a small (but formidable) speaker at the bottom of the tree, and my Supernight music controller would utilize it's sound to run the strip LEDs on the back of the wide ribbon. (Mode 1 would be quiet enough not to disturb the supernight controller, so it would only fire up the ribbon strip once the main speaker came on.) The mega and whatever power hardware I need to run everything will go into a box under the tree disguised as a Christmas present with the wires hidden under a tree skirt.
Sign In or Register to comment.