Demo integer counter with blinking 7-segment LED display.
Channel: ORMicroportal
Date: 2015-06-02

Uses a Microchip PIC18F45K20 Microcontroller, two 4-digit 7-segment LED displays, and 4 N.O buttons.  This project demonstrates using a single function (Display_LED_Int) to display an integer number onto a 7-segment LED display, which can support two to eight LED digits, and will display integer numbers as either Decimal, Hexadecimal, or Octal.  The program displays an “E” at most significant digit, to indicate an error when number is larger than available display digits.  Supports attribute flag bit to control each digit's on/off state, allowing control of individual digits, allowing a single digit to be turned off or turned on, allowing any combination of digit(s) to blink.

Little source code change is required, because this program uses a definition file (Config_LED_Digits.def) to pre-configure all pin connections for designing your own 7-segment LED display.  Both common-anode and common-cathode digits are supported inside the definition file.

Operation:
There are three buttons; Start/Hold, Reset, and Base. Pressing Start/Hold starts counting; pressing Start/Hold again stops counting, causing display to blink indicating a held time. Pressing Start/Hold again will continue counting from the currently held time.  You can continue pressing Start/Hold button to toggle between continuing and holding the count.  Pressing Reset will clear the count setting display to [0] and will hold at zero without blinking display (RESET mode).  To protect from accidentally resetting count, reset will not work unless count is held.  Pressing Base (while counting or holding ) will change the number's base causing either hexadecimal, octal, or decimal numbers to be displayed.

Note: This was second project, used to test the multitasking display technique, which I used to test integer numbers with different bases (Dec, Hec, Oct).  To test floating-point numbers, please see my other project titled “Demo floating-point stopwatch with blinking 7-segment LED display.”

Addendum Nov 25th, 2021.
Because of the way YouTube intermittently displays comments, I have included the following link for this project, here! inside the description section.

Link to all the documentation, including my code and flowcharts for project: Demo-Counter_v98r
https://drive.google.com/drive/folders/0B9URPYB2KEyIWGRCYmdLSjNuVW8?resourcekey=0-XRGgTIJMvfjCAeY6KGb82A&usp=sharing

Created by Philip. N, for Microportal the Electronic Club.
Demo-Counter_v98r.