|
MBI5026驱动心得
MBI5024 单片机C语言驱动程序。
#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;
}
}
全部资料51hei下载地址:
|
评分
-
查看全部评分
|