找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開始

搜索
查看: 3641|回復(fù): 3
收起左側(cè)

89c52.51單片機(jī)蜂鳴器程序 -- 極樂(lè)凈土 功能可以實(shí)現(xiàn)親測(cè)

[復(fù)制鏈接]
ID:396815 發(fā)表于 2019-6-17 09:42 | 顯示全部樓層 |閱讀模式
下面是例子,試過(guò)可以使用

#include <REG52.H>   
#include <INTRINS.H>   
#include "reg52.h"       
typedef unsigned int u16;          //對(duì)數(shù)據(jù)類型進(jìn)行聲明定義
typedef unsigned char u8;

sbit k1=P3^1;         //定義P31口是k1



sbit Beep =  P1^5;

unsigned char n=0;      
unsigned char code music_tab[] ={ 0xff,  
               

         0x1c,0x10,0x1c,0x20,0x20,0x10,
0x1c,0x10,0x1c,0x20,0x20,0x10,
0x1c,0x10,0x1c,0x20,0x20,0x10,
0x1c,0x20,0x18,0x20,

0x1c,0x10,0x1c,0x20,0x20,0x10,
0x1c,0x10,0x1c,0x20,0x20,0x10,
0x1c,0x20,0x18,0x20,0x15,0x20,0x13,0x20,

0x2b,0x10,0x26,0x10,
0x39,0x08,0x40,0x08,0x39,0x08,0x40,0x08,

0x2b,0x10,0x26,0x10,
0x39,0x08,0x40,0x08,0x39,0x08,0x40,0x08,

0x2b,0x10,0x26,0x10,
0x39,0x08,0x40,0x08,0x39,0x08,0x40,0x08,

0x30,0x10,0x33,0x10,0x39,0x10,0x40,0x10,
       
0x2b,0x10,0x26,0x10,
0x39,0x08,0x40,0x08,0x39,0x08,0x40,0x08,

0x2b,0x10,0x26,0x10,
0x39,0x08,0x40,0x08,0x39,0x08,0x40,0x08,
                               
0x2b,0x10,0x26,0x10,0x20,0x10,0x18,0x10,
0x19,0x08,0x18,0x08,0x19,0x08,0x1c,0x08,
0x20,0x10,0x26,0x10,

  0x2b,0x10,0x26,0x10,
0x39,0x08,0x40,0x08,0x39,0x08,0x40,0x08,

0x2b,0x10,0x26,0x10,
0x39,0x08,0x40,0x08,0x39,0x08,0x40,0x08,

0x2b,0x10,0x26,0x10,
0x39,0x08,0x40,0x08,0x39,0x08,0x40,0x08,

0x30,0x10,0x33,0x10,0x39,0x10,0x40,0x10,



  0x39,0x10,
  0x40,0x08,0x39,0x08,0x30,0x10,
  0x39,0x08,0x30,0x08,0x2b,0x10,
  0x2b,0x08,0x26,0x08,0x20,0x08,
  0x18,0x08,0x26,0x08,0x20,0x08,
  0x18,0x10,0x19,0x08,0x18,0x08,
  0x19,0x08,0x1c,0x10,0x20,0x10,
  0x1c,0x10,0x20,0x10,0x1c,0x10,




                                          0xff,0xff,0xff,0xff ,


                                         0x00
};   


unsigned char code music_tab1 [] = { 0xff,    0x18,0x08,0x15,0x10,0x13,0x10,
0x1c,0x08,0x20,0x08,0x1c,0x08,0x20,0x08,
  0x15,0x10,0x13,0x10,
0x1c,0x08,0x20,0x08,0x1c,0x08,0x20,0x08,
  0x15,0x10,0x13,0x10,
0x1c,0x08,0x20,0x08,0x1c,0x08,0x20,0x08,                       
  0x18,0x10,0x19,0x10,0x1c,0x10,0x20,0x10,
   0x15,0x10,0x13,0x10,
0x1c,0x08,0x20,0x08,0x1c,0x08,0x20,0x08,
  0x15,0x10,0x13,0x10,
0x1c,0x08,0x20,0x08,0x1c,0x08,0x20,0x08,
0x15,0x10,0x13,0x10,0x10,0x10,0x0c,0x10,
0x0d,0x08,0x0c,0x08,0x0d,0x08,0x0e,0x08,
0x10,0x10,0x13,0x10,
0x15,0x10,0x13,0x10,
0x1c,0x08,0x20,0x08,0x1c,0x08,0x20,0x08,
  0x15,0x10,0x13,0x10,
0x1c,0x08,0x20,0x08,0x1c,0x08,0x20,0x08,
  0x15,0x10,0x13,0x10,
0x1c,0x08,0x20,0x08,0x1c,0x08,0x20,0x08,
0x18,0x10,0x19,0x10,0x1c,0x10,0x20,0x10,


1 (極樂(lè)凈土).zip

13.72 KB, 下載次數(shù): 57, 下載積分: 黑幣 -5

回復(fù)

使用道具 舉報(bào)

ID:396815 發(fā)表于 2019-6-17 09:42 | 顯示全部樓層
只是一部分,全部還在文件里面
回復(fù)

使用道具 舉報(bào)

ID:558859 發(fā)表于 2019-6-22 21:54 | 顯示全部樓層
沒(méi)有下載就扣除黑幣了
回復(fù)

使用道具 舉報(bào)

ID:396815 發(fā)表于 2019-12-10 14:26 | 顯示全部樓層
qysj22 發(fā)表于 2019-6-22 21:54
沒(méi)有下載就扣除黑幣了

有的,沒(méi)有的話點(diǎn)擊鏈接就可以了
回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表