Assignment: Input / Output Coincidence Lab Assignment
Collaborators:
Description:
For this project, I used a portable bike pump as a way of creating a different type of interaction when using a Piezo buzzer as an input. The output goes to an LED.
Components used:
/* Piezo Knock * ----------- * Turn a standard piezo buzzer into a force sensor * * Created 24 October 2006 * copyleft 2006 Tod E. Kurt THRESHOLD ) { // is it bigger than our minimum? digitalWrite(ledPin, HIGH); // tell the world t = 0; while(analogRead(piezoPin) > THRESHOLD) { t++; } // wait for it to go LOW (with a little hysteresis) if(t>100) { // cut off the low values because they're noise Serial.println("knock! "); Serial.println(t); } } }
Images:
Bike pump, connected to a Piezo buzzer.