收藏 分享(赏)

51单片机按键控制数码管程序.doc

上传人:精品资料 文档编号:10670113 上传时间:2019-12-18 格式:DOC 页数:2 大小:22.50KB
下载 相关 举报
51单片机按键控制数码管程序.doc_第1页
第1页 / 共2页
51单片机按键控制数码管程序.doc_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

1、#include#define uint unsigned int#define uchar unsigned charuchar c;sbit p10=P10;sbit p11=P11;sbit p12=P12;sbit p13=P13;sbit p14=P14;sbit p15=P15;sbit p16=P16;sbit p17=P17;void delay(uint z);int b=0,1,2,3,4,5,6,7;/设置每一位显示的数字unsigned char code Tab=0xc0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0x8

2、8,0x83,0xC6,0xA1,0x86,0x8E;/共阳极数码管int a=0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80;void main() EA=1;EX0=1;IT0=1;P1=0xff; while(1)for(c=0;c0;a-)for(b=110;b0;b-);int_0()interrupt 0EA=0;if(p10=0) b0=(b0+1)%10;if(p11=0) b1=(b1+1)%10;if(p12=0) b2=(b2+1)%10;if(p13=0) b3=(b3+1)%10;if(p14=0) b4=(b4+1)%10;if(p15=0) b5=(b5+1)%10;if(p16=0) b6=(b6+1)%10;if(p17=0) b7=(b7+1)%10;EA=1;

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 企业管理 > 管理学资料

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报