这是电路图,怎么用中断的方式实现暂停,开始,还有怎么添加按键实现控制滚动速度。
我的程序只能实现滚动。
#include<reg51.h> #include <intrins.h> #define uchar unsigned char #define uint unsigned int uchar code DSY_CODE[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e,0xff}; ucharNumber[]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}; void DelayMS(uint x) { uchart; while(x--)for(t=0;t<120;t++); } void main() { uchari,j,k=0,m=0x80; while(1) { for(i=0;i<15;i++) { for(j=0;j<8;j++) { P0=0xff; P0=DSY_CODE[Number[(k+j)%17]]; m=_crol_(m,1); P2=m; DelayMS(4); } } k=(k+1)%17; } }
|