8x8 dot matrix display 26 English letters#include <reg52h> #define uchar unsigned char #define uint unsigned int sbit diola=P2^5; sbit dula=P2^6; sbit wela=P2^7; unsigned int countm=50i=0; uchar
(65535-50000)%256; //50ms定时器 TCON=0x10; //启动定时器 EA=1; //开全局中断 } void main() { init(); while(1) { for(count=0;count<8;count++) { dula=1; P0=0xff; dula=0; P0=table[i][count]; delay_1(); wela=1; P0=0xfe; wela=0; } delay(m); //延时50ms if(++i==26) i=0; } } void timer() interrupt 1 { TH0=(65535-50000)/256; TL0=(65535-50000)%256; m--; //每50ms计数减一 if(m==0) { m=50; //重新赋值为50 i++; //显示下一个字母 if(i==26) i=0; } }
原文地址: http://www.cveoy.top/t/topic/fkyp 著作权归作者所有。请勿转载和采集!