資源簡(jiǎn)介
74HC595級(jí)聯(lián)輸出原理圖+程序+仿真(proteus)

代碼片段和文件信息
#include?
//#include?
#define uchar?unsigned?char
#define uint?unsigned?int
uchar?code?bseg[16]={0xf00xf10xf20xf30xf40xf50xf60xf70xf80xf90xfa0xfb0xfc0xfd0xfe0xff};//列驅(qū)動(dòng)選碼(低位)
/*uchar?SEGx[32]={0x080x240x880x330x780x2C0x0F0x23
????????????????0xC80x280x080x700x200x000xF80xFF
????????????????0x4F0x220x480x220x490x220xFE0x3F
????????????????0x480x220x480x220x080x200x000x00};/*“雄“0*/
uchar?SEGx[32]={0x000x000xFC0x070x440x040x440x04
????????????????0x440x040xFC0x070x100x000x900x00
????????????????0x100x030x100x400x100x800xFF0x7F
????????????????0x100x000x100x000x100x000x000x00};/*“時(shí)“0*/
sbit?LEDshclk=P2^0;
sbit?LEDdata=P2^1;
sbit?LEDstclk=P2^2;
void?delay(void)
{
unsigned?int?ij;
for(i=0;i<1;i++)
{
for(j=0;j<5;j++)
{;}
}
}
void?hc164send(uchar?c)
{?uchar?temp;
for(temp=0;temp<8;temp++)
????{
?if(c?&0x80)
?????????????LEDdata?=?1;
???else??LEDdata?=?0;
???LEDshclk=0;
???delay();
???LEDshclk=1;
???delay();
???c<<=1;
????}
}
void?hc595out(void?)
?{LEDstclk=0;
??delay();
??LEDstclk=1;
??delay();
??}
void?main(void)
{uchar?n;
while(1)
{
??
??for(n=0;n<16;n++)
?{
??????P1=bseg[n];
??hc164send(SEGx[2*n+1]);
??????????hc164send(SEGx[2*n]);
??hc595out();
?? ??delay();?//delay(); ?delay();?//?delay(); ???delay();
??}
?}
???
?}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????3680??2008-09-11?15:03??595LED\595LED
?????文件???????1493??2008-08-14?19:15??595LED\595LED.c
?????文件?????103792??2008-08-14?19:16??595LED\595led.DSN
?????文件????????971??2008-09-11?15:03??595LED\595LED.hex
?????文件?????????45??2008-09-11?15:03??595LED\595LED.lnp
?????文件???????3844??2008-09-11?15:03??595LED\595LED.LST
?????文件???????6434??2008-09-11?15:03??595LED\595LED.M51
?????文件???????3362??2008-09-11?15:03??595LED\595LED.OBJ
?????文件???????1036??2008-08-14?21:03??595LED\595LED.Opt
?????文件????????371??2008-09-11?15:04??595LED\595LED.plg
?????文件????????742??2008-08-14?19:21??595LED\595led.PWI
?????文件???????2191??2008-09-11?15:04??595LED\595LED.Uv2
?????文件???????1043??2008-08-14?19:21??595LED\595LED_Opt.Bak
????.......??????2181??2008-08-14?19:21??595LED\595LED_Uv2.Bak
?????文件?????103792??2008-08-14?19:15??595LED\Last?Loaded?595led.DBK
?????文件???????6376??2007-09-11?14:50??595LED\STARTUP.A51
?????文件??????14049??2008-09-11?15:03??595LED\STARTUP.LST
?????文件????????749??2008-09-11?15:03??595LED\STARTUP.OBJ
?????目錄??????????0??2008-08-21?12:12??595LED
-----------?---------??----------?-----??----
???????????????256151????????????????????19
評(píng)論
共有 條評(píng)論