isd1420.h
来自「此程序是基于89s52单片机的c程序」· C头文件 代码 · 共 61 行
H
61 行
#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
sbit Play = P3^0;
void delay1ms(int t)
{
uint i,j;
for(i=0;i<t;i++)
for(j=0;j<120;j++);
}
uchar code tab[ ]={0x00,0x10,0x18,0x20,0x28,0x30,0x38,0x40,0x48,0x50,0x58,0x60,0x68,0x70};
void fa_sheng(uint i)
{
P2 = tab[i];
Play = 1;
Play = 0;
delay1ms(400);
}
void du_wen(uint temp)
{
uint thou,hun,ten,dat;
thou = temp/1000;
hun = temp%1000/100;
ten = temp%100/10;
dat = temp%10;
fa_sheng(0);
delay1ms(1000);
fa_sheng(thou+1);
delay1ms(130);
fa_sheng(11);
delay1ms(220);
fa_sheng(hun+1);
delay1ms(100);
fa_sheng(12);
delay1ms(150);
fa_sheng(ten+1);
delay1ms(100);
fa_sheng(dat+1);
delay1ms(250);
fa_sheng(13);
delay1ms(400);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?