/* 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/2)) { t++; } // wait for it to go LOW (with a little hysteresis) if(t!=0) Serial.println(t); } }