Midterm_Veronica


Leftovers” is a project I started last semester in Sabine Seymour’s Fashionable Technology.


“Ruby Heels” was my second assignment in Physical Computing 1. Using a sensor/component to create sound. I really enjoyed working with the piezo contact speaker and want to experiment with it more.


For my midterm project I chose to experiment with nitinol wire, piezo contact sensor and LEDs.


//Veronica Black
//Pcomp 1 Midterm Oct.25, 2013

/* Knock Sensor

This sketch reads a piezo element to detect a knocking sound.
It reads an analog pin and compares the result to a set threshold.
If the result is greater than the threshold, it writes
“knock” to the serial port, and toggles the LED on pin 13.

The circuit:
* + connection of the piezo attached to analog in 0
* – connection of the piezo attached to ground
* 1-megohm resistor attached from analog in 0 to ground

http://www.arduino.cc/en/Tutorial/Knock

created 25 Mar 2007
by David Cuartielles
modified 30 Aug 2011
by Tom Igoe

This example code is in the public domain.

*/

// these constants won’t change:
const int ledPin = 13; // led connected to digital pin 13
const int nit = 8;
const int knockSensor = A0; // the piezo is connected to analog pin 0
const int threshold = 100; // threshold value to decide when the detected sound is a knock or not

// these variables will change:
int sensorReading = 0; // variable to store the value read from the sensor pin
int ledState = LOW; // variable used to store the last LED status, to toggle the light

void setup() {
pinMode(ledPin, OUTPUT); // declare the ledPin as as OUTPUT
pinMode(nit, OUTPUT);
Serial.begin(9600); // use the serial port
}

void loop() {
// read the sensor and store it in the variable sensorReading:
sensorReading = analogRead(knockSensor);

// if the sensor reading is greater than the threshold:
if (sensorReading >= threshold) {
// toggle the status of the ledPin:
ledState = !ledState;
// update the LED pin itself:
digitalWrite(ledPin, ledState);
digitalWrite(nit, ledState);
// send the string “Knock!” back to the computer, followed by newline
Serial.println(“Knock!”);
}
delay(100); // delay to avoid overloading the serial port buffer
}

164 thoughts on “Midterm_Veronica

  1. Deborah

    This design is incredible! You obviously know how to keep a reader entertained.
    Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Fantastic job.
    I really enjoyed what you had to say, and more than that, how you presented it.
    Too cool!

  2. Coleman

    Oh my goodness! Awesome article dude! Thank you so much, However I am having problems with your RSS.
    I don’t understand the reason why I can’t join it. Is there anybody else getting identical RSS problems?
    Anyone who knows the solution will you kindly respond?
    Thanks!!

  3. Epifania

    Hello i am kavin, its my first time to commenting anywhere, when i read this post i
    thought i could also make comment due to this brilliant piece of writing.

  4. Elton

    Hello! I could have sworn I’ve been to this site before but after browsing
    through some of the post I realized it’s new to me. Nonetheless, I’m definitely delighted I found it and I’ll be bookmarking and checking back frequently!

  5. Virginia

    Hello there, I found your site via Google while looking for a similar topic, your
    web site got here up, it appears great. I have bookmarked it in my google bookmarks.

    Hi there, simply became aware of your weblog through Google,
    and located that it’s really informative. I’m going to be careful for brussels.

    I’ll appreciate when you proceed this in future. Numerous people shall be
    benefited from your writing. Cheers!

  6. Graciela

    Its like you read my thoughts! You appear to grasp a lot about this, like
    you wrote the e-book in it or something. I believe
    that you just could do with some percent to pressure the message home
    a bit, but other than that, this is excellent blog. An excellent read.

    I will definitely be back.

  7. hi

    Hi there would you mind letting me know which webhost you’re working with? I’ve loaded your blog in 3 completely different web browsers and I must say this blog loads a lot faster then most. Can you suggest a good internet hosting provider at a fair price? Thanks a lot, I appreciate it!|

  8. Terese

    Hmm it looks like your blog ate my first comment
    (it was extremely long) so I guess I’ll just sum it up what I submitted and say, I’m thoroughly enjoying
    your blog. I as well am an aspiring blog writer but I’m still new to everything.
    Do you have any suggestions for novice blog writers?

    I’d certainly appreciate it.

  9. Loreen

    I’m amazed, I have to admit. Seldom do I encounter a blog
    that’s equally educative and entertaining, and without a doubt, you have hit the nail on the head.

    The problem is something too few men and women are speaking intelligently
    about. I am very happy that I found this in my search for something
    concerning this.

  10. Alina

    Link exchange is nothing else except it is just placing the other person’s
    website link on your page at suitable place and other person will also do similar in favor of you.

  11. Alanna

    Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog
    that automatically tweet my newest twitter updates.
    I’ve been looking for a plug-in like this for quite some time and was
    hoping maybe you would have some experience with something like this.

    Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.

  12. Claudio

    Hello there! Would you mind if I share your blog with my twitter group?

    There’s a lot of folks that I think would really
    enjoy your content. Please let me know. Cheers

  13. Martina

    I was wondering if you ever considered changing the structure of your site?

    Its very well written; I love what youve got to say. But maybe you could a little more in the way of content
    so people could connect with it better. Youve got an awful
    lot of text for only having one or two pictures.
    Maybe you could space it out better?

  14. Marilou

    After looking at a few of the blog articles on your site, I seriously appreciate your
    way of writing a blog. I book-marked it to my bookmark webpage list and will
    be checking back soon. Take a look at my web site too and let
    me know your opinion.

  15. Patrick

    Hello just wanted to give you a quick heads up. The words in your post seem to be running off the screen in Internet explorer.

    I’m not sure if this is a formatting issue or
    something to do with internet browser compatibility but I thought I’d post to let you know.

    The design look great though! Hope you get the issue fixed soon. Thanks

  16. Ivy

    It’s very effortless to find out any matter on net as compared to books, as I
    found this piece of writing at this web page.

  17. casinosite

    I’ve been searching for hours on this topic and finally found your post. casinosite, I have read your post and I am very impressed. We prefer your opinion and will visit this site frequently to refer to your opinion. When would you like to visit my site?

Leave a Reply

Your email address will not be published.