30秒倒计时 c语言51单片机实现.docx
《30秒倒计时 c语言51单片机实现.docx》由会员分享,可在线阅读,更多相关《30秒倒计时 c语言51单片机实现.docx(2页珍藏版)》请在三一办公上搜索。
1、30秒倒计时 c语言51单片机实现 原理图: 程序: #include #define uchar unsigned char #define uint unsigned int sbit dula=P26; sbit wela=P27; sbit D=P23; uint tt,temp,shi,ge,a; uchar code 0x3f,0x06,0x5b,0x4f, 0x66,0x6d,0x7d,0x07, 0x7f,0x6f,0x77,0x7c, 0x39,0x5e,0x79,0x71; void delay(uint z); void chushi; void xianshi(uint
2、 temp); void main chushi; while(1) if(tt=20) tt=0; if(temp0;x-) for(y=110;y0;y-); void chushi /设置定时器1为工作方式1 temp=30; TMOD=0X01; TH0=(65536-50000)/256; TL0=(65536-50000)%256; EA=1; ET0=1; TR0=1; void zhongduan interrupt 1 /中断函数子程序不需要声明 TH0=(65536-50000)/256; TL0=(65536-50000)%256; tt+; void xianshi(uint temp) /显示子程序 uint shi,ge; shi=temp/10; ge=temp%10; P0=shumashi; dula=1; dula=0; P0=0xfe; wela=1; wela=0; delay(2); P0=shumage; dula=1; dula=0; P0=0xfd; wela=1; wela=0; delay(2);
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 30秒倒计时 c语言51单片机实现 30 倒计时 语言 51 单片机 实现

链接地址:https://www.31ppt.com/p-3146937.html