数码管俩位显示0到99加中断程序

[复制链接]
查看11 | 回复3 | 2012-12-20 19:28:28 | 显示全部楼层 |阅读模式
这本质是数码管的动态显示,所谓的动态显示是指数码管一位一位的轮流显示.每次只让一个数码管亮,还有就是要能分清楚共阴极与共阳极的区别.#include#define uint unsigned int#define uchar unsigned char//宏定义uchar code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};uchar num;sbit p1=P2^0;sbit p2=P2^1;void init();//初始化函数void delay(uint z);//延时函数...
回复

使用道具 举报

千问 | 2012-12-20 19:28:28 | 显示全部楼层
下面的程序是采用两只按键一只加1,一只清0.两只数码管十位P0,个位P2口送段码。本程序来自:《单片机C语言程序设计实训100例——基于8051+Proteus仿真》#include #define uchar unsigned char#define uint unsigned intuchar DSY_CODE[]=...
回复

使用道具 举报

千问 | 2012-12-20 19:28:28 | 显示全部楼层
#include#define uint unsigned int#define uchar unsigned charuint a,num=0;uchar code table[]={ 0x3f,0x06,0x5b,0x4f,0x66, 0x6d,0x7d,0x07,0x7f,0x6f,};void...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行