Single-chip programming: Let the LED digital tube display the number 0 to 9

Source: Internet
Author: User
LED digital tube is widely used in single-chip microcomputer system, it is composed of light-emitting diode. The digital tube consists of 7 LEDs of a "day" shape, if the need to display the decimal point, then add a point, is a 8-segment digital tube.

Digital tube Display high brightness, the corresponding speed, sub-common cathode and common anode two forms, commonly used have a single and 4-linked, there are two and dedicated to display time.

/*************************************************** * Program function: Light up an LED digital tube, let it show numbers from 0 to 9  * * Date: 2015.5.11       ******* /#include <reg52.h> #define LONG 50000#define Short 10000// The glyph code is defined, and the table array is loaded with a self 0 to 9unsigned int table[] = {0xc0, 0xf9, 0xa4, 0xb0, 0x99, 0x92, 0x82, 0xf8, 0x80, 0x90};//delay function void Dela Y (int i) {while (i--) {}}void main () {int i = 0;while (1) {for (i = 0; i <; i++) {  P0 = table[i];  Delay (LONG);}}}


Single-chip programming: Let the LED digital tube display the number 0 to 9

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.