[hackpgh-discuss] Re: Raspberry pi zero

  • From: Matthew Beckler <matthew.beckler@xxxxxxxxx>
  • To: "hackpgh-discuss@xxxxxxxxxxxxx" <hackpgh-discuss@xxxxxxxxxxxxx>
  • Date: Fri, 2 Sep 2016 10:13:46 -0500

Sounds like an excellent project. Give me a bit of time to digest and I'll
reply later this afternoon.

-Matthew

On Fri, Sep 2, 2016 at 10:12 AM, Jeremy Tiogar <jeremy.tioger@xxxxxxxxx>
wrote:

Heh, it's my first step into microcontroller s this century, except for a
semester using vex controllers. So I'm not 100% on anything I'm doing. Lol

The accelerometer I got is https://www.adafruit.com/products/2019?gclid=
Cj0KEQjwxqS-BRDRgPLp0q2t0IUBEiQAgfMXRKphTjEyy8ayj8HV9AN6pa2GV212qE58gbh8
0UfBPTUaAkJe8P8HAQ

If the rasp pi is overkill, I can still use it and replace with something
simpler later, correct? I know I'll need it to run my ironman suits, so I
have no regrets on snagging it. ;)

No, it doesn't have audio out. So I'll need to add a module.

I guess I should be really specific on what I need it to do. As I said,
I'm not as familiar with these things as I'd like, so I'm not sure how much
horsepower it needs.

It needs to power on an LED, while playing the appropriate sound, doing so
as a fade in. It also needs to do the reverse on power down. When simply
on, it needs to make that humming noise while pulsing light slightly.

When swung, I want it to cycle through random sounds from a list of four
or so. It would be cool if specific movements triggered specific sounds,
but I'm unsure if that's possible. Upon blade contact, it should pulse the
LED alternate color and play one of a few random sounds.  If contact is
prolonged, it flashes the blade with alternate color while playing a
different sound.

My package needs to do all that, and fit in a tube 1.25 inches inside and
8 or so long. With storage for the mp3s and a power pack.

Lol.....that's a lot now that I write it out.

Thank you again for helping.:)

Jeremy

On Sep 2, 2016 10:24 AM, "Matthew Beckler" <matthew.beckler@xxxxxxxxx>
wrote:

Hi Jeremy,

Unless you are trying to do bluetooth, wifi, or connect to a computer/tv
display, I would suggest using a microcontroller instead of the raspi
(which is a full computer running an operating system and all that sort of
overhead you probably don't need and will just waste power). Something like
the Teensy, Arduino Pro Mini, or the adafruit trinket would probably be
perfect. Also does the RasPi zero even have an audio output jack?

If you want to sense motion and output sound, a Teensy + Prop Shield
might do the trick. The Teensy is a really great microcontroller board, and
the prop shield adds motion sensors (10 degrees of freedom), an audio
amplifier that can drive common 4 or 8 ohm speakers. https://www.sparkfun
.com/products/13995 - The Teensy boards are programmed using the Arduino
IDE and are really great, I use them all the time in museum exhibits.
https://www.sparkfun.com/products/13736

If you really want to stick with the raspberry pi zero, what kind of
accelerometer did you get? What is the interface (serial? I2C? analog?).
You'll need to figure out how to access the accelerometer data from a
little script (python or bash or something like that), and then trigger a
command-line audio program like mpg123 or aplay.

Sounds like a fun project!

-Matthew IV



On Fri, Sep 2, 2016 at 12:03 AM, Jeremy Tiogar <jeremy.tioger@xxxxxxxxx>
wrote:

Well, I've got a Raspberry pi zero and an accelerometer on the way. Good
start to the guts of my lightsaber.

Any recommendations on books or sites to get my feet wet?

I need to program it to sense direction and speed to output sound and
power to an LED. Also power on / off like a standard computer with a
momentary contact switch.



Other related posts: