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