xlndz 发表于 2012-2-21 12:52:53

8*点阵显示器

http://cache.amobbs.com/bbs_upload782111/files_52/ourdev_720766VAJBJV.jpg
(原文件名:88.jpg)

#include<reg51.h>

void delay(unsigned int ms){
while(ms--);
}

void main(void){
//unsigned char TAB={0x10,0xFE,0x92,0x92,0xFE,0x92,0x10,0x10,0x10,0xFE,0x92,0x92,0xFE,0x92,0x10};                  //列
unsigned char TAB={0x00,0x81,0xff,0x08,0x14,0x22,0xc1,0x00,0x00,0x81,0xff,0x08,0x14,0x22,0xc1};
int a,b,c;
while(1){
        for(a=0;a<8;a++){
                for(b=0;b<100;b++){
                        P2=0x01; //行
                        for(c=0;c<8;c++){
                                P0=~TAB;        //列
                                delay(100);
                                P2=P2<<1|P2>>7;
                                }
                        }
                }
        }
}
页: [1]
查看完整版本: 8*点阵显示器