P Comp Project 1

Flushing out some ideas–

Idea 1

The first idea I had was to make a pressure sensitive microphone tin/holder. When I work on shows, we have aluminum bread tins that hold wireless microphones. My thought was to add force sensitive resistors to the base of it below some type of layer that when something is placed upon it, say a microphone, after a certain amount of time a light will turn green, signaling that a microphone is present. The sensors will have a threshold to where it will turn green, and when that threshold isn’t reached, it will turn red meaning no microphone is present.

Below is a basic sketch.

Idea 2

Another idea — which I’ve literally just thought of as I typed the above entry — is for an automatic LED strip. I have a travel Pelican case that I use to house tools and other work necessities, and currently I have a strip of LED lights around the rim of the lid that sometimes turns on when I use the remote. Something I could possible do is have it turn on automatically when (1) the case is open and (2) when it’s dark and there is little light present.

Below is what it looks like at the moment.

Idea 3 – The Chosen One

I was thinking about what I could make that involved a combination of sound or tune of sorts along with buttons and the servo motor. One of the first things I thought of was the Jeopardy theme, which traumatized me in high school when my sophomore geometry teacher would play the theme song as we all raced to fill in a blank circle of pie chart before the song ended.

I got this idea from those coin / toy boxes that can sense coins on a platform and a little hand of a cute animal like a panda reaches out to drag the coin into the box, or another example is similar but there is a toggle switch that when you switch it, a hand pops out to switch it back, and this goes back and forth.

My idea is to create a similar style box that when a sequence of buttons are pushed, it would trigger the playing of the Jeopardy theme while simultaneously teasing the opening of the lid. Such that the lid will slowly open, close a little, and back and forth throughout the whole song until the very end when the lid fully opens. However, my thought was to have a 5 second threshold that if the sequence is pressed again before 5 seconds are up then the lid would stay open, if not then the lid would close, and if you wanted to open it, you’d have to listen to the whole tune again.

The images below are basic pseudocode and also the notes for the melody.

My next step is going to program the tune so that it comes out properly, then to code the sequence of buttons pressed that would trigger the tune.

Here I managed to program the jeopardy tune, it’s not perfect, but one can tell that that’s what it is. The rhythm is a little off, but it is a computer and I am new to Arduino.

At first it was a little tricky, I tried to do bits at a time, and adjust the noteDuration. For a while, after the last note I programmed it would end on a different note and just play out continuously. I was using the lab from week 3 as reference using the pitches library and code, and saw that what was ‘thisNote < 8’ in the lab cod, I needed to adjust to the number of notes I had. I’m not sure if this was the correct approach, but I was able to end on my last note that I had entered.

I DID IT !!!!!

By it, I mean I was able to write the code so that when one button is pressed, it triggers the tune.

Currently, I am struggling a bit to program a button sequence that only when pressed will it trigger the tune. So far, I’ve been able to program it so that when all 3 buttons are pressed at once, the tune plays, and most recently, when a sequence of the 3 buttons are pressed the tune plays. However, it’s the 3 buttons in any order, not a particular combination.

Update:

I was able to write code so that a pushbutton when pressed will trigger the tune, and once the tune is done a servo motor will move (door opens) and after a five second delay the motor resets (door closes).

I’m not sure why, but when I try to combine the code for the three button input that triggers the tune, and the servo actions, it does not work.

FINAL – Video

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s