写一个stc89c52rc用蜂鸣器播放迪迦奥特曼的主题曲奇迹再现蜂鸣器引脚是P1^5;#include REGX52H
#include <REGX52.H>
void delay(unsigned int time) //延时函数 { unsigned int i,j; for(i=0;i<time;i++) for(j=0;j<120;j++); }
void main() { while(1) { P1 ^= 0x20; //将P1^5引脚输出高低电平交替 delay(200); //延时200毫秒 } }
原文地址: https://www.cveoy.top/t/topic/hkUZ 著作权归作者所有。请勿转载和采集!