打印
[经验分享]

[转]一个十字点阵的c程序

[复制链接]
2141|5
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
suoma|  楼主 | 2010-3-11 22:29 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
//by double z
#include
#define FENBIANLV 150
#define CYCLEMUN 10
bit over =1;
unsigned char pianyi=0;
unsigned char cntcyclenum=0;
unsigned char code tab[]={ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, //每行8条的宽度 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0x1E,0xDC,0xDE,0xBD,0xDE,0x7D,0xDE,0xBD,0x40,0xC1,0x7F,0xFF,0x7F,0xFF,0x00,0x00, 0x3F,0x7E,0x5F,0xBD,0x6F,0xDB,0x77,0xF7,0x7B,0xEF,0x7D,0xDF,0x7F,0xBF,0xFF,0xFF, // 0xDF,0xFE,0xEF,0xFE,0xD7,0xFE,0x1B,0x00,0xD9,0x7E,0xDA,0x9E,0xFF,0xFF,0xD7,0xD6, 0xDB,0xB6,0xD9,0x76,0x0A,0x00,0xD3,0xF6,0xDB,0xF6,0x1F,0xF0,0xFF,0xFE,0xFF,0xFF, // 0x07,0xFF,0x73,0xFE,0xF9,0xFC,0xFC,0xF9,0xFC,0xF3,0xF9,0xE7,0xF3,0xCF,0xE7,0x9F, 0xE7,0x9F,0xF3,0xCF,0xF9,0xE7,0xFC,0xF3,0xFC,0xF9,0xF9,0xFC,0x73,0xFE,0x07,0xFF, // 0xFF,0xDF,0xFB,0xDF,0xFB,0xDF,0xFB,0xDF,0xFB,0xDF,0xFB,0xDF,0xFB,0xDF,0x03,0xC0, 0xFB,0xDF,0xFB,0xDF,0xFB,0xDF,0xFB,0xDF,0xF9,0xDF,0xFB,0xCF,0xFF,0xDF,0xFF,0xFF,//工 0xFF,0xBF,0xEF,0xBF,0x9F,0xBF,0x7F,0xB8,0xFF,0xBF,0x00,0x80,0xFF,0xBF,0xFF,0xBF, 0xFF,0xBF,0x00,0x80,0xFF,0xBB,0xFF,0xBC,0x3F,0xBF,0xCF,0x9F,0xFF,0xBF,0xFF,0xFF,//业 0xDF,0xFF,0xDF,0xBF,0xDF,0xBF,0xDF,0xDF,0xDF,0xEF,0xDF,0xF3,0x5F,0xFC,0x80,0xFF, 0x5F,0xFE,0xDF,0xF9,0xDF,0xF7,0xDF,0xEF,0xDF,0xDF,0xCF,0x9F,0xDF,0xDF,0xFF,0xFF,//大 0xBF,0xFB,0xCF,0xFB,0xEE,0xFB,0x69,0xFB,0x6F,0xFB,0x6F,0xBB,0x6E,0x7B,0x69,0x81, 0x6F,0xF9,0x6F,0xFA,0x67,0xFB,0xEB,0xFB,0xEC,0xFB,0xAF,0xF9,0xCF,0xFB,0xFF,0xFF,//学 };
void set(void) { EA=1; //全局中断开 EX2=1; //外部中断2打开 IT2=1; //外部中断2边沿触发 }
void delay(unsigned int i) { while(i--); }
void show(unsigned char *add)
{ unsigned char i; unsigned char *addreset; over=0; addreset=add; add+=pianyi*2; for(i=0;i(FENBIANLV*2)) add=addreset; add=add+2; P1=*add; P3=*(add+1); } over=1; }
void main(void) { set(); //P2=P0=0; //可以加背景色 while(1); }
void int2(void) interrupt 6 //外部中断
{ if(over) { show(tab); }
cntcyclenum++; if(cntcyclenum==CYCLEMUN) { pianyi++; cntcyclenum=0; } if(pianyi==FENBIANLV) pianyi=0; }
沙发
Karlshen| | 2010-3-11 23:12 | 只看该作者
好乱啊,看晕了:dizzy:

使用特权

评论回复
板凳
thf2008| | 2010-3-12 12:24 | 只看该作者
那个数组的定义好像不怎么对把,怎么在注释还有东西

使用特权

评论回复
地板
liliang9554| | 2010-3-12 20:20 | 只看该作者
楼主不要害人哦

使用特权

评论回复
5
huamunv| | 2010-3-12 22:03 | 只看该作者
注释里有个工业大学:lol

使用特权

评论回复
6
huamunv| | 2010-3-12 22:03 | 只看该作者
这个程序可不行啊

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

82

主题

714

帖子

5

粉丝