MBI5024驱动程序

来源:互联网 发布:易语言模拟按键源码 编辑:程序博客网 时间:2024/05/04 16:31

MBI5024驱动程序

  

16-Bit LED显示驱动芯片驱动程序,MBI5024驱动程序,MBI5026驱动程序,MBI5024C语言驱动程序。

#include<reg52.h>
sbit MBI_SDI = P0^1;
sbit MBI_CLK = P0^0;
sbit MBI_OE = P0^2;
sbit MBI_LE = P0^3;

void delay(unsigned int i)
{
   while(i>0)i--;
}
void wr5024byte(unsigned int dat)
{
    unsigned char i;
   for(i=0;i<16;i++)
    {
       MBI_SDI=(dat &0x8000)?1:0;
       MBI_CLK=1;
       dat<<=1;
       MBI_CLK=0;
    }
    MBI_LE = 1;
    delay(100);
    MBI_LE = 0;
}
void main()
{
    MBI_CLK = 0;
    MBI_SDI = 0;
    for(;;)
    {
       wr5024byte(0x5555);
       delay(1000);
       MBI_OE = 0;
       delay(1000);
       MBI_OE = 1;
    }
}

 
1 0
原创粉丝点击