首页 🥳笔记

请注意,本文编写于:2021-02-08,最后编辑于26天前,内容可能已经不具有时效性,请谨慎参考。

🟢共阳极

012345
0xc00xf90xa40xb00x990x92
6789AB
0x820xf80x800x900x880x83
CDEF无显示
0xc60xa10x860x8e0xff

🔵共阴极

012345
0x3f0x060x5b0x4f0x660x6d
6789AB
0x7d0x070x7f0x6f0x770x7c
CDEF无显示
0x390x5e0x790x710x00

#include "reg52.h"
typedef unsigned char u8;
typedef unsigned int u16;
unsigned char light[17]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e,0xff};

void delay(u16 i)
{
    while(i--);
}

void main()
{
    u8 k;
    while(1)
    {    
        for(k=0;k<17;k++)
        {
            P2 = light[k];
            delay(50000);
        }
    }
}



文章评论