资源描述:
《点阵程序.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、#include#include#defineucharunsignedchar#defineclkP2_5#definesclkP2_6#defineenP2_4#definedatP2_7voidhang(uchara){uchark;//P2=0;//en=1;for(k=0;k<8;k++){dat=a&0x80;clk=1;clk=0;a<<=1;}//sclk=1;//sclk=0;}delay1ms(unsignedcharm){unsignedcharn;while(m--){for(n=0;n<122;n++);}}voi
2、dmain(void){uchari,j,q;ucharcodea[32]={0x01,0x00,0x01,0x04,0xFF,0xFE,0x01,0x00,0x02,0x00,0x3F,0xFC,0x24,0x24,0x22,0x44,0x2F,0xF4,0x21,0x04,0x3F,0xFC,0x21,0x04,0x21,0x04,0x21,0x14,0x21,0x08,0x00,0x00};ucharcodeb[32]={0x00,0x00,0x7D,0xFC,0x45,0x04,0x49,0x04,0x49,0x04,0x51,0x04,0x49,0xFC,0x45,0x0
3、4,0x45,0x04,0x45,0x04,0x69,0x04,0x51,0x04,0x41,0xFC,0x41,0x04,0x40,0x00,0x40,0x00};ucharcodec[32]={0x00,0x00,0x03,0xFC,0xFA,0x44,0x22,0x44,0x23,0xFC,0x22,0x44,0xFA,0x44,0x23,0xFC,0x22,0x44,0x20,0x40,0x23,0xFC,0x38,0x40,0xC0,0x40,0x00,0x40,0x0F,0xFE,0x00,0x00};ucharcoded[32]={0x00,0x00,0x3F,0xF
4、C,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0xFF,0xFE,0x00,0x00,0x00,0x00};while(1){P2=0;en=1;//P3=0xff;for(j=0;j<62;j++){for(i=0;i<32;i=i+2){hang(a[i]);hang(a[i+1]);q=(31-i)/2;P2=P2&0xf0;P2=P2
5、q;sclk=1;sclk=0;delay1ms(1);}}fo
6、r(j=0;j<62;j++){for(i=0;i<32;i=i+2){hang(b[i]);hang(b[i+1]);q=(31-i)/2;P2=P2&0xf0;P2=P2
7、q;sclk=1;sclk=0;delay1ms(1);}}for(j=0;j<62;j++){for(i=0;i<32;i=i+2){hang(c[i]);hang(c[i+1]);q=(31-i)/2;P2=P2&0xf0;P2=P2
8、q;sclk=1;sclk=0;delay1ms(1);}}for(j=0;j<62;j++){for(i=0;i<32;i=i+2){hang(d[i]);hang(d[
9、i+1]);q=(31-i)/2;P2=P2&0xf0;P2=P2
10、q;sclk=1;sclk=0;delay1ms(1);}}}}