alto777
15
State Change (or Edge) Detection along with some way to accommodate switch bouncing is an essential first bit of power you can take for yourself.
See this post and the thread it is part of; read the code play with it in the simulator until it makes sense:
HTH
a7