the function call just partly work

Hi AOWL,
I will make some modification in the future step by step and use other continous data later. What's your suggestion?
I just make modification as the following?

const int N=10;
float voltageValue[N];

I test my coding with oscilloscope, there is only one wave instead of holding for the press duration when I press the sensor.
What is the reason why my code only partly work? is related with the definition for the variable?

Big thks