I have tried your program but I have a problem with the addition, I want when the data that passes the threshold value will do the sum then when the data after that does not pass the threshold it will be a reset value to add up next when it exceeds the threshold again