parts pick and knowledge help

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
JamesBryan
 
Posts: 134
Joined: Mon Jun 29, 2015 2:39 pm

parts pick and knowledge help

Post by JamesBryan »

Im looking to add sound and variable light effects to my project but im not sure what to get. im looking to use the advice from this in a few projects so im describing the general functions rather than project specific aspects, the simplest way to describe what i want to do is the way a decent quality lightsaber replica works. im using an arduino pro trinket as the core of this. i want the project to play a specific sound with the initial light activation and then immediately cut into a constant repeating sound loop until i trigger the "off/standby" when it will play a designated sound . i do want it to play an impact triggered sound and an alternate light effect momentarily and then return back to "normal" as well. i know how to change the light effect modes but im wanting to add the ability to cycle through various colours while remaining in the active effect mode. i have seen various sound components and im perfecty fine running separate batteries for the sound board and the light board and i can rig a main power, impact sensor and "activate/standby" button to both, but i dont know which ones would be good or where to look to find out how to write the code for what i want it to do. ive looked through the learn section and i cant find a tutorial on how to have the mode and colour select as separate trigggers or how to trigger the sound effects the way i want them to work.

User avatar
JamesBryan
 
Posts: 134
Joined: Mon Jun 29, 2015 2:39 pm

Re: parts pick and knowledge help

Post by JamesBryan »

the other function i forgot to mention is that i would prefer the mode select and the "activate/standby" buttons be separate and to activate or go into standby mode i have to hold down that button for a couple of seconds.

User avatar
JamesBryan
 
Posts: 134
Joined: Mon Jun 29, 2015 2:39 pm

Re: parts pick and knowledge help

Post by JamesBryan »

ok, update on this, i found the code i need to give me separate mode and colour cycle and even though they use a regular trinket in their project, it wont be hard to adapt this to a pro trinket...https://www.hackster.io/Richa1/adafruit ... ode-43bcd8

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: parts pick and knowledge help

Post by adafruit_support_mike »

You're probably heading in the right direction.

The FX Board has a Serial control interface, so a microcontroller can tell it what to do. Given the kind of behavior you want and the sensors to make it work, that would probably be the best option.

User avatar
JamesBryan
 
Posts: 134
Joined: Mon Jun 29, 2015 2:39 pm

Re: parts pick and knowledge help

Post by JamesBryan »

which specific board would you suggest as the best pairing with the pro trinket? the closer to similar footprint the better to be honest. also, is there a tutorial you can point me to on how to program in the "push for two seconds activate/extinguish" effect? i plan on having mode select on switch one, colour cycle on switch two and the activate/standby on switch three. i already have the mode/colour select skecth that will get that going and could just modify it to mode cycle from off to a single mode but a few of my projects have more than one "active" animation

User avatar
JamesBryan
 
Posts: 134
Joined: Mon Jun 29, 2015 2:39 pm

Re: parts pick and knowledge help

Post by JamesBryan »

never mind, i realized the only difference was the capacity, should have looked before i asked. ok i do still need to figure our how to do the activate/standby on its own switch and i found a tutorial on the fx board so that should help me get started on learning to add sound

User avatar
JamesBryan
 
Posts: 134
Joined: Mon Jun 29, 2015 2:39 pm

Re: parts pick and knowledge help

Post by JamesBryan »

ive been looking and im having a hard time finding a tutorial for the last few things i need to work out on this. i need for two different animations to be going at the same time. i need to figure out how to get the pro trinket to make one strip display one animation on one of the strips while the other strip has a different set of animations. i know how to do what i need to do using multiple pro trinkets but i need to try to cut down on how many components im using because im already having to use two different batteries as it is and im not sure if trying to charge both using a split harness from a single charging backpack is a good idea and trying to run three separate induction chargers is going to present issues due to space limitations as it is.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: parts pick and knowledge help

Post by adafruit_support_mike »

Take a look at our series of tutorials on multitasking:

https://learn.adafruit.com/search?q=multitasking

The general idea is that you can't do more than one thing in code built lile this:

Code: Select all

    for ( int i=0 ; i , someLimit ; i++ ) {
        doSomething( i );
        delay( someTime );
    }
You have to remove the delay() and the outer loop, and treat each animation as a series of frames identified by numbers, all of which can be played at any time if you use the right number. That reduces the problem to keeping track of multiple counters, which is much, much easier.

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

Return to “General Project help”