Making counter from limitswitch

hi
I want to make a counter.when I press limitswitch,this counter 1 increase.And I will show on glcd

How can ı this ?

Imported from wikidot