首页下载资源行业研究两位数码管显示0-59.zip

ZIP两位数码管显示0-59.zip

2301_8171757098.97KB需要积分:1

资源文件列表:

两位数码管显示0-59.zip 大约有24个文件
  1. 两位数码管显示0-59/
  2. 两位数码管显示0-59/Last Loaded 电路图.DBK 97.43KB
  3. 两位数码管显示0-59/Last Loaded 电路图.pdsbak 16.75KB
  4. 两位数码管显示0-59/Listings/
  5. 两位数码管显示0-59/Listings/STARTUP.lst 13.81KB
  6. 两位数码管显示0-59/Listings/程序.lst 3.07KB
  7. 两位数码管显示0-59/Listings/程序.m51 6.88KB
  8. 两位数码管显示0-59/Objects/
  9. 两位数码管显示0-59/Objects/STARTUP.obj 819B
  10. 两位数码管显示0-59/Objects/程序 3.63KB
  11. 两位数码管显示0-59/Objects/程序.build_log.htm 1.09KB
  12. 两位数码管显示0-59/Objects/程序.hex 888B
  13. 两位数码管显示0-59/Objects/程序.lnp 99B
  14. 两位数码管显示0-59/Objects/程序.obj 3.34KB
  15. 两位数码管显示0-59/STARTUP.A51 6.23KB
  16. 两位数码管显示0-59/电路图.DSN 97.43KB
  17. 两位数码管显示0-59/电路图.PWI 742B
  18. 两位数码管显示0-59/电路图.pdsprj 17.75KB
  19. 两位数码管显示0-59/电路图.pdsprj.LAPTOP-2DIP0A31.lenovo.workspace 2.15KB
  20. 两位数码管显示0-59/程序.c 1.29KB
  21. 两位数码管显示0-59/程序.uvgui.lenovo 88.89KB
  22. 两位数码管显示0-59/程序.uvopt 5.62KB
  23. 两位数码管显示0-59/程序.uvproj 14.11KB
  24. 两位数码管显示0-59/程序文本.txt 1.42KB

资源介绍:

两位数码管显示0-59.zip
#include typedef unsigned int u16;//定义无符号整型变量 typedef unsigned char u8; //定义无符号字符型变量 u16 miao; u8 code smgduan[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};//共阴极数码管段码 void delay(u16 i)//延时函数 { while(i--); } void timer0init() //时间函数 { TMOD=0x10; //设置T1为工作方式1 ET1=1; EA=1; TR1=1; //启动定时器T1 TH1=(65536-1000)/256;//对TH1赋值,50ms TL1=(65536-1000)%256;//对TL1赋值 } void main() { u16 i; //定义无符号整型变量i timer0init(); //调用时间函数 while(1) { for(i=0;i<2;i++) //循环2次 { switch(i) { case(0):P1=0x01;P0=smgduan[miao%10];break;//当i=0时,显示个位 case(1):P1=0x02;P0=smgduan[miao/10];break;//当i=1时,显示十位 } delay(1000);//延时1秒 P0=0x00; //数码管灭 } } } void timer0() interrupt 3 //数码管函数 { u16 i; //定义无符号整型变量i TH1=64536/256; //重新赋值 TL1=64536%256; i++; //i自增1 miao==0; //数码管初始值显示00 if(i==1000) //当i=1000 { miao++; //数码管加1 i=0; //i=0 } if(miao==60) //当数码管为60时 { miao=0; //数码管值为0 } }
100+评论
captcha