Can anyone suggest a way to program the arduino so that it creates
vibration only when the pressure on the piezo has not exceeded a
certain amount for a specified period (say, 10 seconds).
This example displays a vibration whenever pressure is applied to the
piezo.
Write a program that keeps checking the pressure and if it has exceeded the threshold pressure set a long int variable called say alarm to the current time given by millis();
Also in the same loop check that the value of millis() plus the time interval you want to trigger the alarm from is greater than the alarm variable. If t is not then do the alarm code.
Thank you! That is great. However, I am a novice and have just ordered my first arduino (an uno). Can you provide a little more information about how to implement your suggestion, or suggest a resource that I could use to implement what you have said?
I am a novice and have just ordered my first arduino
Well do some of the tutorial examples, play about with it for a week. Look at the blink without delay example. Change things and see the results. Learn to predict what those changes will produce.
Write some sketches using your flex sensor to do stuff, even if it is not quite what you want at the moment
Then soon you will see implementing what I said is quite simple.
There is no point in me doing it for you as you would not learn anything from that.
If you still have trouble, post the code in the programming section (use the # icon please), say what you want to do, say what it actually does and ask for help. But it is something you should be able to do easily.