格式:pdf
大小:29KB
頁數: 5頁
基于單片機 C52 的音樂播放 C 語言程序 //此程序在硬件上調試通過 //本程序的單片機晶振采用 11.0592M #include "reg52.h" #include "intrins.h" //#define uchar unsigned char //#define uint unsigned int sbit BEEP = P1^0; sbit S1 = P3^3; sbit S2 = P3^5; unsigned char timer0h,timer0l,timer0h1,timer0h2,timer0l1,timer0l2,time1,time2; //void Delay_MS(); 保存了 4 個八度的 28個頻率數據 unsigned char code FREQH[]= { 0xf2,0xf3,0xf5,0xf5,0xf6,0xf7,0xf8