51 of the Code
#include <reg51.h> #include <intrins.h> #define int8 unsigned char#define int16 unsigned int#define int32 unsigned long int8 code num_tab[10][8]={{0xff,0xff,0xc1,0xbe,0xbe,0xc1,0xff,0xff},/* "0", 0*/{0xff,0xff,0xde,0x80, 0xfe,0xff,0xff,0xff},/* "1", 1*/{0xff,0xff,0xdc,0xba,0xb6,0xce,0xff,0xff},/* "2", 2*/{0xff,0xff,0xdd,0xb6,0xb6, 0xc9,0xff,0xff},/* "3", 3*/{0xff,0xff,0xf1,0xcd,0x80,0xfd,0xff,0xff},/* "4", 4*/{0XFF,0XFF,0X86,0XB6,0XB6,0XB9, 0xff,0xff},/* "5", 5*/{0xff,0xff,0xc1,0xb6,0xb6,0xd9,0xff,0xff},/* "6", 6*/{0xff,0xff,0x9f,0xb8,0xb7,0x8f,0xff, 0xff},/* "7", 7*/{0xff,0xff,0xc9,0xb6,0xb6,0xc9,0xff,0xff},/* "8", 8*/{0xff,0xff,0xcd,0xb6,0xb6,0xc1,0xff,0xff},/* "9", 0*/};void delay (int x), void main (void) {int8 i;int8 j;int8 K; P3 = 0x80;while (1) {for (j = 0; J <, J + +) {for (k = 0; k <, k++) {for (i = 0; i < 8; i++) {P0 = 0xFF; P0 = Num_tab[j][i]; P3 = _crol_ (p3,1);d elay (1);}}} void delay (int x) {int16 i,j;for (i=0;i<x;i++) {for (j=0; J <; J + +);}}
Schematic diagram of the circuit implemented
Significant effect
51 8*8 dot-matrix display number