51单片机C语言程序(三)数码管
利用动态扫描方法在六位数码管上显示出稳定的654321.
时钟频率为11.0592M
#include
#include
#define uint unsigned int
#define uchar unsigned char
sbit dula=P2^6;
sbit wela=P2^7;
uchar code table[]={
0x3f,0x06,0x5b,0x4f,
0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,
0x39,0x5e,0x79,0x71};
void display(uchar,uchar,uchar,uchar,uchar,uchar); //函数声明
void delay(uint);
void main()
{
}
void display(uchar one,uchar two,uchar three,uchar four,uchar five,uchar six)
{
}
void delay(uint z)
{
}
程序二
用动态扫描方法和定时器1在数码管的前三位显示出秒表,
精确到1%秒,即最后一位显示1%秒,一直循环下去
#include
#include
#define uint unsigned int
#define uchar unsigned char
sbit dula=P2^6;
sbit wela=P2^7;
uchar ge,shi,bai;
uint tt;
uchar code table[]={
0x3f,0x06,0x5b,0x4f,
0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,
0x39,0x5e,0x79,0x71};
void display(uchar,uchar,uchar); //函数声明
void delay(uint);
void main()
{
}
void exter0() interrupt 3
{
}
void display(uchar one,uchar two,uchar three)
{
}
void delay(uint z)
{
}
评论