Sparkly Problem? Flora, LED Sequins and Contact Switch

Wearable electronics: boards, conductive materials, and projects from Adafruit!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
PhantomGremlin
 
Posts: 1
Joined: Thu Jun 25, 2015 10:27 am

Sparkly Problem? Flora, LED Sequins and Contact Switch

Post by PhantomGremlin »

Good morning!
I'm new to Adafruit and have recently encountered some problems. I am working on the show "Gypsy" as an electrician, and I have been asked to make a particularly sparkly piece of costuming for one of the strippers, who needs to light up and sparkle. The costume department ordered 45 LED Sequins, an Adafruit Flora board, several contact switches, some of the conductive thread, and 3.7 volt 150 mAH battery pack. In the past, I've worked with normal LEDs and radio shack switches, but this is a new concept to me. I've explored the various tutorials and such, and got the Flora up and running and programming, but now have hit a snag.
The circuitry itself is relatively simple in theory. I need several strings of LEDs that light up//twinkle when the button is pressed, and then turn off when the button is pressed again. I should be able to wire 5 LED sequins in parallel, sharing one of the D circuits and a common ground, correct? So I would like several strings that twinkle independently of each other. I'm not really sure exactly how the Flora and its programming will tie all of these elements together... so any help you could offer would be greatly appreciated

User avatar
caitlinsdad
 
Posts: 627
Joined: Fri Feb 24, 2012 4:23 pm

Re: Sparkly Problem? Flora, LED Sequins and Contact Switch

Post by caitlinsdad »

Look at the Adafruit learning system for a tutorial on the LED sequin hat. You can use that code as a basis although it is written for the Gemma. You can mod that sketch for the Flora if you use data pins 6, 9, 10 which are analogwrite PWM capable instead of the 0,1 and 2 for the Gemma. Wire up your 5 sequins in parallel for each of those pins. Duplicate the lines of code for those pins but use a different offset or starting brightness value to appear as though each string is different. If you have the strings of sequins placed all over the costume, you will see a more random light up effect.

If you want to throw an on/off toggle switch in there, use one of the other data pins like D12. There are many tutorials on arduino.cc to set up a switch with pullup resistor in the circuit. You may also be able to set up the internal pullup on that pin if available. The program needs to have the "debounce" code to sense and distinguish a single switch press(the result may go high or low, change it you don't see any effect) which will trigger your IF then segment to run the lights. Note that the switch sensing is part of the big loop so you may have to wait until a cycle of light twinkles display loop completes. The more complicated way to sense immediately when you press the switch is to use interrupts in programming which is a bit more advanced.

Good luck.

Locked
Please be positive and constructive with your questions and comments.

Return to “Wearables”