It seems like it should work, but I will ask these questions:
On reset is ampm on?
When you push portb.7 the first time does it turn off?
If so, it appears you will need to press the portb.7 switch 1320 more times to get it to turn back on. Have you tried that?
I don't see where anything increments your MILS variable other than portb.7. so no other variables will increment until you press the button. Maybe what you changed was how cnt affects the program?
As a side note, even a few comments sprinkled around go a long way to help others debug your program![]()
Bookmarks