Count number of times the box opened.

The event triggers both closing and opening the box,
but it is an electric issue. The serial port opens on setup
and does not close.

Lots of work to do, but it would be fine to add a diagram of the circuit.