////////语音播报子程序
#define __ISD1420_H__
#include "main.h"
#include "clock.h"
#include"lcd1602.h"
#define ISD1420IO P1 //播音地址端口
sbit playe = P3^0; //开始播音口
extern const unsigned char speak_world[];
void speak_isd1420(unsigned char addr);
#include "ISD1420.h"
const unsigned char speak_world[]={0x00,0x00,0x08,0x10,0x18,0x20,0x28,0x30,0x38,0x40,0x48,0x50,0x58};
//const unsigned char speak_world1[]={0x00,0x00,0x08,0x10,0x18,0x20,0x28,0x30,0x38,0x40,0x48,0x50,0x58};
/*********延时K*1ms,12.000mhz**********/
void delay_ISD1420(unsigned int ms)
{ int j;
while(ms--)
{
for(j=0; j<125; j++);
}
}
/*********语音播报子程序 addr播音地址**********/
void speak_isd1420(unsigned char addr)
{
ISD1420IO = addr; //写地址
{ playe = 1;
playe=0; //开始播音
delay_ISD1420(600);
}
}
////语音播报温度子程序
#include "speakTEMP.h"
void delay(unsigned int ms)
{ int j;
while(ms--)
{
for(j=0; j<125; j++);
}
}
/*********语音播报温度子程序**********/
void speak_temp(unsigned int temp_t){
int digit1,digit0;
digit1 = temp_t / 10; //十位
digit0 = temp_t % 10; //个位
{
speak_isd1420(speak_world[12]);//当前温度是
delay(600);
if(digit1==0){
speak_isd1420(speak_world[digit0]);
speak_isd1420(speak_world[11]);
}
else{
speak_isd1420(speak_world[digit1]);
speak_isd1420(speak_world[10]); //播十
if(digit0!=0)
speak_isd1420(speak_world[digit0]);
speak_isd1420(speak_world[11]); //播度
}
}
/////时钟程序
#include "clock.h"
unsigned char seconde=0; //定义并初始化时钟变量
unsigned char minite=0;
unsigned char hour=12;
unsigned char mstcnt=0;
unsigned char code str0[]={"time: : : "};
/***************定时器t0初始化*******************/
void initClock(void)
{
seconde=0;
minite=0;
hour=12;
mstcnt=0;
initLCM( );
TMOD=0x01; //time0为定时器,方式1
TCON = 0x01 ; //触发方式为脉冲负边沿触发
TH0=0x3c; //预置计数初值
TL0=0xb0;
EA=1;
ET0=1;
TR0=1;
EX0=1;
}
/***************液晶显示子函数1正常显示*****************/
void displayClock(void)
{
WriteCommandLCM(0x0c,1); //显示屏打开,光标不显示,不闪烁,检测忙信号
DisplayListChar(0,0,str0);
DisplayOneChar(5,0,hour/10+0x30);
DisplayOneChar(6,0,hour%10+0x30);
DisplayOneChar(8,0,minite/10+0x30);
DisplayOneChar(9,0,minite%10+0x30);
DisplayOneChar(11,0, seconde/10+0x30);
DisplayOneChar(12,0,seconde%10+0x30);
}
/***********定时器t0中断子函数**************/
void timer0(void) interrupt 1 using 0 //定时器0方式1,50ms中断一次
{
TH0=0x3c;
TL0=0xb0;
mstcnt++;
if(mstcnt>=20 ) {seconde++; mstcnt=0; }
if(seconde>=60) {minite++; seconde=0;}
if(minite>=60 ) {hour++; minite=0; }
if(hour>=24 ) {hour=0;}
}
这是手动报温,我想设置整点报温,当到每一个整点时,他就会自动报温
都不介绍你用什么单片机和什么型号的语音芯片
QQ:2213825928 语音芯片、模块。串口MP3芯片、模块 http://mk020.taobao.com
回复 沙发 iushiyuan 的帖子
是51单片机,语音芯片是ISD1420
语音芯片里面存储需要用到的各种语音。
等时钟走到整点的时候。读出温度值,并根据温度值指向语音芯片相应语音提示的位置