Recording and timer start when analog voltage is read. The relay function works once and stops until the recording function is stopped and restarted.
But your point is important. If the recording and timer are started, what if the voltage rises again? I'll have to tweak the code a bit for that.
-It should ignore the voltage spike when the loop is started. Because if it looped on the first voltage spike, it is sufficient. If it is in the loop, if I try to start the loop again, it may cause errors. For this, it should ignore it.