完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
#include
#define uchar unsigned char void delay(unsigned int n) //??????? {unsigned int x,y; for(x=0;x } ***it RS=P2^0; //?????***??????????? ***it RW=P2^1; ***it E=P2^2; ***it led1=P2^3; ***it led2=P2^4; int count,fen,miao,shi,k,key,i; char keyscan(); /*void write_command(char com) //д?????????? { E=0; RS=0; RW=0; P1=com; E=1; E=0; delay(1); } void write_data(char dat) //д?????????? { E=0; RS=1; RW=0; P1=dat; E=1; E=0; delay(1); } void lcd_initial(void) //lcd????? { write_command(0x38); write_command(0x0c); write_command(0x06); delay(1); } void string(uchar position,uchar *s) //?????????? { write_command(position); while(*s>0) {write_data(*s++); delay(1); } }*/ unsigned char keyscand(void) //??????躯?? { unsigned char a,b; P3=0xf0; if(P3!=0xf0) //?ж?????а??????? {delay(10); if(P3!=0xf0) //?????????? { a=P3; //???????????а????????? P3=0xf0; //????? b=P3;}} //???????????а????????? return a+b;} //?????? void main(void) { led1=1; led2=1; while(1); { P3=0xf0; key=keyscand(); switch ( key ) //?ж???????????????£? { case 0xee: k='0'; break; //??????? case 0xed: k='1'; break; case 0xeb: k='2'; break; case 0xe7: k='3'; break; case 0xde: k='4'; break; case 0xdd: k='5'; break; case 0xdb: k='6'; break; case 0xd7: k='7'; break; case 0xbe: k='8'; break; case 0xbd: k='9'; break; case 0xbb: k='A';break; case 0xb7: k='B';break; case 0x7e: k='C';break; case 0x7d: k='D';break; case 0x7b: k='E';break; case 0x77: k='F';break; } if(k=0) {led1=0;} if(k=1) led2=0;} } /* lcd_initial();//????????? EA=1; //????? ET0=1; //??????T0?????ж? TMOD=0x01; //T0???1 TH1=(65536-50000)/256;//????????????50ms TL1=(65536-50000)%256; TR0=1; IT0=1; EX0=1; EX1=1; while(1);*/ /*void timer0() interrupt 1 //?ж? { TH1=(65536-50000)/256; TL1=(65536-50000)%256; count++; //???????????????????1S string(0x81,"A331"); string(0x86,"B332"); string(0xCE,"64"); write_command(0xC1); //???shi???λ write_data(0x30+shi/10); write_command(0xC2); //???shi???λ write_data(0x30+shi%10); string(0xC3,":"); write_command(0xC4); //???fen???λ write_data(0x30+fen/10); write_command(0xC5); //???fen???λ write_data(0x30+fen%10); string(0xC6,":"); write_command(0xC7); write_data(0x30+miao/10); write_command(0xC8); write_data(0x30+miao%10); if(count==1) //20ms*50=1S {count=0; miao++;} //?????miao+1 if(miao==60) { miao=0; fen++;} //?????fen+1 if(fen==60) { fen=0; shi++;} if(shi==24) {shi=0;}}*/ |
|
|
|
只是说一句没反应,别人没法帮你分析的。你要把电路图,操作过程,现象等都详细描述下,别人才好对症下药。
|
|
|
|
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
205 浏览 0 评论
求助一下关于51系列单片机的Timer0的计时问题,TH0、TL0+1的时间是怎么算的?
1253 浏览 1 评论
【RA-Eco-RA4E2-64PIN-V1.0开发板试用】开箱+Keil环境搭建+点灯+点亮OLED
848 浏览 0 评论
【敏矽微ME32G070开发板免费体验】使用coremark测试敏矽微ME32G070 跑分
853 浏览 0 评论
【敏矽微ME32G070开发板免费体验】开箱+点灯+点亮OLED
1073 浏览 2 评论
【youyeetoo X1 windows 开发板体验】少儿AI智能STEAM积木平台
12010 浏览 31 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-22 19:38 , Processed in 1.108526 second(s), Total 88, Slave 68 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号