本文主要是介绍51的8*8点阵显示数字,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
51的代码
#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 < 10; j++){for(k = 0; k < 20; k
这篇关于51的8*8点阵显示数字的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!