i have been trying around with several scripts for two days but i am not able to solve this problem on my own and i am totally lost and confused at the moment: I have a piezo wired to Analog 5 (with pulldown resistor etc) and i want the arduino to count the number of vibrations (above a fixed threshold) within a given timeframe: For example: The first vibration / shock starts the timer of e.g. 20 seconds. Every vibration/shock within that timeframe is added to the number of counts. (Afterwards i want to make the program do something depending from the number of shocks but i will try to figure out how this works by myself)
could you please help me?
thank you so much