No.41423 作者:月如镜 邮件:cenyizhg@yahoo.com.cn ID:9079 登陆:63次 文章数:54篇 最后登陆IP:218.4.82.204 最后登陆:2005/8/15 19:58:54 注册:2003/2/14 19:00:00 财富:206 发帖时间:2003/9/3 22:59:29 发贴者IP:218.2.171.60 标题:月如镜:哪位朋友帮帮忙?谢谢。改日请喝茶。 摘要:No.41423哪位朋友帮帮忙?谢谢。改日请喝茶。 #include <reg51.h> sbit PinScanKey1=P1^2; sbit PinScanKey2=P1^4; sbit PinScanKey3=P1^5; sbit PinScanKey4=P0^4; sbit PinScanKey5=P0^3; #define TRUE 1 #define FALSE 0 #define DELAY_value 5 unsigned char a[8]; unsigned char bdata count; sbit count0=count^0; sbit count1=count^1; sbit count2=count^2; sbit p2_4=P2^4; sbit p0_6=P0^6; sbit p0_5=P0^5; code unsigned char tb[31]={0xfc,0x60,0xda,0xf2,0x66,0xb6,0xbe,0xe0,0xfe,0xf6,0xee,0x3e,0x9c,0x7a,0x9e,0x8e,0x2e,0x1c,0x72,0x2a,0x3a,0xce,0x7c,0x00,0x10,0x80,0x02,0x82,0x1e,0x12,0x92}; /* ?0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,h,l,j,n,o,p,u,dark,low-,high-,mid-,high=,t,low=,三?`` */ unsigned char bdata keyword; unsigned char bdata keyboard; sbit keyword0=keyword^0; sbit keyword1=keyword^1; sbit keyword2=keyword^2; sbit keyword3=keyword^3; sbit keyword4=keyword^4; void coms() interrupt 1 { TH0=0xf8; TL0=30; SBUF=tb[a[count]]; p2_4=count0; p0_6=count1; p0_5=count2; while(TI) { TI=0; } if(count <7)count++; else count=0; } void sinit(void) {SCON=0; TMOD=1; TH0=0x80; TL0=0x20; TR0=1; EA=1; ET0=1; TI=0; } void keyinit(void) {PinScanKey1=1; PinScanKey2=1; PinScanKey3=1; PinScanKey4=1; PinScanKey5=1; } void delay(short i) { int k=0; k=i*DELAY_value; while(k--); } unsigned char test(unsigned char bdata keyw ......
>>返回讨论的主题
|