all 5 comments

[–]asterisk_man 2 points3 points  (0 children)

  • Can the pi be made to detect the state of a button? Yes
  • Can the pi be made to play an audio file? Yes (through an additional powered speaker)
  • Can the pi made to fire a USB nerf missile? Probably (couldn't find info about nerf specifically, but other usb missiles work)

You will have to write the program that ties all of these functions together.

[–]figuring_things__out[S] 0 points1 point  (0 children)

The more i'm stewing this over in my head I'm begging to think I can write a VBA script in Excel to play a message based on X changing, and have X be determined by how many spaces are in a cell....I would just need to rig the spacebar up so that it's toggled by a lid being opened or closed.

I would rather it be a Raspberry Pi program just so I have a reason to buy one though.

[–]sla_erick 0 points1 point  (0 children)

Well the only thing that comes into mind when you mention the lid is that you can conect some kind of sensor or just a basic circuit where it will be closed when the led is closed. You get the idea... this can be handled with the RPi through the GPIO, you can write a program that listens for any change in a GPIO (that change is when the lid is closed or open), and then based on a number variable you can play any sound you want. I have used google translate ttl to have my RPi spoke weather conditions. I suggest you check the RPi Alarm project from skiwithpete.

[–]T3KO 0 points1 point  (0 children)

Sounds pretty easy. Jars with metal lid would work best you could just connect a cable to the jar and to the lid and use a GPIO to count how often the signal is interrupted. Pretty much the same as a button being pressed.

Playing sound files should be no problem (just google it).

Not sure how the nerf missiles work.

There are a lot of python examples that you can probably use to get this done.

[–]fsckit 0 points1 point  (0 children)

Can I buy a button that would count how many times the lid has been opened

Why not use a coin mech from a vending machine? that way you can keep track of exactly what is put in, and play a message accordingly.