F0recaster12

New Member
I am trying to make a custom blaster, using foam and PVC (and other odds and ends)...in fact I have most of it built.

The question I have is more about the assignable LEDs...has anyone seen or programmed a sound/light kit that would let you hold the trigger of the blaster and allow it to "power up" much like a Grunt Plasma Pistol in Halo. In particular I would love to have the LED's either gradually intensify with the length the trigger is depressed...or gradually activate the LED strip in sequence so it looks like some sort of energy buildup in the baster
 

Attachments

  • custom-blaster.png
    custom-blaster.png
    1.3 MB · Views: 261
Sure.... are you using an Arduino then? *(you dont say)

If you already have things this far... I"m sure you can work out the code to get this going.

I suggest you millis() and start your 'count' upon trigger press.. and continue on until you release.. (what happens when you let go?)

you can then analyze the millis() count and divide by your threshold and increment the led strip each time it is met.
 
Yep arduino is the way to go. You can get pro minis really cheap.... If you want to be extra tight on size a 8mhz tiny would be more than powerful...

Coding wise, start with a few global variables. 1 to count the number of the build up value... (the number of less being the total.)
And a boolean to store the button/triggered being get pressed value.
You want to tie a state change interupti to the trigger switch pin. And in the i tsrup keep the function small just change your boolean to mirror the action of the button...

I like to use a mini rtos like library called scheduler. Its great to fixing timing, perfect for animated sequences.

What you want to do is set a interval time to trigger your main function... This interval will be your frame rate... And you code your sequence building with this frame rate in mind. The function would take your global that you creates and add 1... And then do the led state based on that global number. So each time the function calls the number increases and the next led turns on......

This is a pretty basic explanation and there is more work, youll also need to code what happens when you let go of the trigger. And what happens when the max number is hit. But that all up to you.

I hope this doesn't all sound too complicated. It really isn't that hard once you figure out the basics of arduino coding
 
man you guys are amazing...I really appreciate the help. The pic might make this look a little better put together than it really is. Basically I can barely solder and this is juryrigged using a neopixel type strip, a generic rf remote (that came with the cheap lights), and a 12v/5v usb power rechargeable cell.

For a total beginner, is there a full Arduino kit that would include the right led driver, circuit board, some sort of soundboard audio/out adaptor, and most of the basics I would need to get a decent version of this running?

(Naturally the more cost effective the better...If I spend too much money my wife might actually find an airlock to throw me out of)
 
Theres no all in one kit that i know of... My genuine honest advise would be to get yourself a cheap aduino clone, maybe from china (where theyre cheapest at Aliexpress) heck get a few... and dont worry about breaking them as theyre pretty cheap... And take some time to learn how to use arduino, program for it and how to wire up neopixel like projects with it...

There is a learning curve but its not that steep really... Just takes a little time. And theres tons and tons of tutorials on the net, youtube, adafruit.... loads.

For good cheap easy to learn programming and electronics Arduino is the way to go, as its so widely supported.

I source all my electronic parts from China via Aliexpress, it really is the cheapest option. And tbh thanks to aliexpress and its price, thats how ive managed to learn electronics and embedded programming. Im far from a rich man, being able to get clones of stuff at a tiny fraction of the price really has helped.

Just be prepared to wait a few weeks for things to turn up, and the occasional thing might never turn up. You do have protection if things go wrong, though sometimes you might have to wait a couple of months to put in a claim...
 
Wait...

How are you getting the Neopixel strip to light up without using a microcontroller of some kind?

As far as price wise.. its VERY cheap..

Pro-Mini = $3.00 USD (roughly)
Neopixels = (not sure how many you need).. but are usually quite affordable (dollars only)


If you want to add in Audio.. then a DFPlayer Mini is also roughly $3.00 USD..

You'll need a couple resistors/capacitors.. (pennies on the dollar)..

a speaker (few bucks...etc)

Over all.. I'd say if you -could- keep this under $25.00 or so.. depending on what you have on hand..etc..


The code will need some time/patience... but I'm sure you'll manage. :)

As far a pre-made kit.. not really..

but any Arduino starter kit is a plus... and a step in the right direction. I always recommend everyone get an UNO (better/faster for prototyping).. as well some Pro-Mini's.. or Nano's (even easier for beginners)

Code works the same on both.. but the smaller pro-mini and Nano are so cheap they can be permanently put in a prop and forgotten about.

If you plan on dabbeling in this hobby more.. I say go on ebay and get yourself an assortment of resistors and capacitors to keep around for when project like this arise.
 
Yeah same, here i alway buy plenty more than I need... So I have a component bin of loads of common parts... Again rather than eBay though, try Ali express... It is cheaper.

Resistors though, shop around. I have a pretty decent supplier in the uk for simple things like that who charges Bearly higher than China, so if i need something fast i go to them... But all mcu stuff like arduino, atmegas, stm32s come from Ali as it's so dawn cheap...

But i certainly suggest you get a few nanos, pro minis as you will likely kill one or two while learning...
 
Another microcontroller option, depending on how many pins you need and how tight space is - take a look at the Digispark. You have four or five pins availalble. Clones are available on ebay for under $2.00. They use a smaller version of the ATMega chip than the usual Arduino, but for a hand prop that won't be a problem.

For example...
1 pin for the trigger
1 pin to control the Neopixels
1 pin to trigger the mp3 player

I have used the YX5300 mp3 player for several projects, it's slightly more expensive (like $4.00 or so). But it needs less work to hook up and includes a small headphone jack on the board, which can be useful.
 
jeff, most sound boxes use standard serial to talk to the host controller... the dfu for instance needs both RX and TX...

Also just looked up the YX5300 and it looks like it might be the same chip as the DFU player... in any case that uses 2 way serial rx tx as well... Also damn they could have made that far more compact in design... its way too large.
 
^ ditto

The DFPlayer uses the XY5200 chip... and the one mentioned above is a XY5300 chip..

not sure of the differences? (or if there are any new/specific libraries for the XY5300? new features?.. if not.. why bother I guess?)

Just seems a bit more user/breadboard friendly if that is something you need... but def. bigger.
 
This thread is more than 5 years old.

Your message may be considered spam for the following reasons:

  1. This thread hasn't been active in some time. A new post in this thread might not contribute constructively to this discussion after so long.
If you wish to reply despite these issues, check the box below before replying.
Be aware that malicious compliance may result in more severe penalties.
Back
Top