Hi Paul,
Thank you for your response.
If it is to be done just once, you need to keep track of the previous state of the switch, so that you can detect the transition (the current state does not match the previous state). The current state then defines whether the transition was pressed-to-released or released-to-pressed.
This is exactly what I want to do except only on the released-to-pressed state. I need help on how to do it.
Thanks