Read solar panels a button?

You need to increment the count when the state of the LDR changes from LOW to HIGH.

...R