contatore

devo aggiungere una variabile stato e old_stato per ogni pulsante?

Certamente.