51单片机实现的音乐闹钟程序代码.pdfVIP

  • 55
  • 0
  • 约2.07万字
  • 约 13页
  • 2021-04-03 发布于湖南
  • 举报
功能描述:产品可以显示时间和日期,时间格式为 hh mm ss 日期格式 为 yy.mm.dd 时间和日期轮流显示。 时间显示 5S 日期显示 3S。 可以设置 5 个闹铃,闹铃音乐可以设置 两种:毛驴和童年。 三个按键对时间和闹铃进行设置,六 个 LED进行显示。 计时采用 DS1307。继电时间不丢失, 设置过的闹铃也不丢失。 闹铃音乐由单片机的两个定时器去产生 频率实现。 部分程序如下: //************************************************* //************************************************ //*********************************************** // 程序名: DS1307 时钟程序 // 功能描述:用六个八段 LED 轮流显示时间 // 和日期。有 6 个闹钟。上电时从 DS1307中读出 // 当前时间、日期、闹钟。 // // // // // b5E2RGbCAP #include reg52.h #include intrins.h #define uchar unsigned char #define uint unsigned int p1EanqFDPw #define LED P2 #define LEDBit P0 #define nop _nop_( DXDiTa9E3d 1 / 13 #define LightCount 40 #define LightMax 80 sbit SCL=P3^1 。 sbit SDA=P3^0 。 sbit ModeKey=P1^0 。 sbit UpKey=P1^1 。 sbit DownKey=P1^2 。 sbit Speak=P3^6 。 code uchar LCD_NUM[10]={0x03,0x9f,0x25,0x0d,0x99,0x49,0x41,0x1f,0x01,0x09} 。 //0x25, //uchar Clock[]={0x88,0x88,0x88} 。RTCrpUDGiT code uint Music_Sound_Long1[]={4,8,4,8,8,4,8,4,4,4, /* 童年 */ 8,4,8,4,4,4,4,4,16,4, 4,8,4,4,4,4,4,8,4,4, 4,8,4,4,4,4,4,4,16,4, 4,8,4,4,4,4,4,8,4,4, 4,8,4,4,4,4,4,4,16,4, 8,4,8,4,4,4,8,8,4,4, 4,4,4,4,4,4,4,4,4,16, 4,8,4,8,8,4,8,4,4,4, 8,4,8,4,4,4,4,4,16,4,

文档评论(0)

1亿VIP精品文档

相关文档