保存桌面快捷方式 - - 设为首页 - 手机版
凹丫丫旗下网站:四字成语大全 - 故事大全 - 范文大全
您现在的位置: 范文大全 >> 理工论文 >> 电子通信论文 >> 正文

LED显示摇棒全套方案及源程序


cbbs.com    2005-1-7
//
//    email: linyige@yahoo.com
//        
//    本设计版权归作者所有,请勿擅自用于商业目的,转载请注明作者及出处
/*************************************************************************/
#include <reg51.h>
#define SEG 17        //每帧图片分成17列来显示
#define INTERVAL 20    //每幅图片在左右摇摆20次后换下一幅

typedef unsigned char u

char;
typedef unsigned int uint;

code char pattern[17][3]={    //3幅图片的字模
{0xff,0xff,0xff},
{0xff,0xff,0xff},
{0xff,0xff,0xff},
{0xff,0x9f,0xff},
{0xff,0x6f,0xf9},
{0xff,0x77,0x65},
{0xfe,0xbb,0x1e},
{0x7e,0xdd,0xfe},
{0x00,0xee,0xfe},
{0x7e,0xdd,0xfe},
{0xfe,0xbb,0x1e},
{0xff,0x77,0x65},
{0xff,0x6f,0xf9},
{0xff,0x9f,0xff},
{0xff,0xff,0xff},
{0xff,0xff,0xff},
{0xff,0xff,0xff},
};


uchar phase,th1,tl1,index,count;


main()
{
    EA=0;
    EX0=1;
    ET1=1;
    PX0=1;        
    IT0=1;     
    TMOD=0x11;
    index=0;
    EA=1;
    while(1)
    {
    }
}

void Int0_Handle(void) interrupt 0 using 2
{
    uint t0_time;
    TR0=0;
    TR1=0;
    TF1=0;
        t0_time=TH0<<8|TL0;
    TL0=0;
    TH0=0;
    TR0=1;
    t0_time=65535-t0_time/SEG;
    th1=t0_time/256;
    TH1=th1;
    tl1=t0_time % 256;
    TL1=tl1;
    if (count<3*INTERVAL){        //3幅图片循环
        count++;
    }
    else{
        count=0;
    }
    index=count/INTERVAL;
 &n

《LED显示摇棒全套方案及源程序(第2页)》
本文链接地址:http://www.oyaya.net/fanwen/view/150326.html

★温馨提示:你可以返回到 电子通信论文 也可以利用本站页顶的站内搜索功能查找你想要的文章。