Originally Posted by lerameur
There's no analyzing. You put the LEDs on PortA.0, A.1, A.2, A.3, set the pins to output. Put the switch on PortB.0, set the pin to input. Light them up in sequence for 1/2 second each.
Then we sit in a loop waiting for the key input to go high (because it's pulled low without the button pressed).
When it goes high, we wait 50ms. If it's still high after 50ms, then we increment the LED count.
After that, it goes into a bunch of IF...THEN statements and sets the LEDs accordingly. If the count is 5, we reset the count back to zero and turn off all the LEDs...
And start over again with checking the button...
What's there to analyze? There is no analyzing. It is straight forward code, nothing hidden, no tricks of programming, no code magic, nothing. Short of
10 PRINT"HELLO"
20 GOTO 10
it doesn't get much easier than this.
JDG




Bookmarks