/******************************************************************************* * 实验名 : 蜂鸣器实验 * 使用的IO : P3^6 * 实验效果 : 蜂鸣器响。 * 注意 :无源蜂鸣器,需要给脉冲信号才会响 *******************************************************************************/ #include sbit Beep = P3^6 ; void Delay10ms(unsigned int); //误差 0us /******************************************************************************* * 函 数 名 : main * 函数功能 : 主函数 * 输 入 : 无 * 输 出 : 无 *******************************************************************************/ void main() { while(1) { Beep = 0x00; //置Beep口为低电平 Delay10ms(100); //调用延时程序 Beep = 0xff; //置Beep口为高电平 Delay10ms(100); // 调用延时程序 } } /***************************************************************************
linux pwm控制蜂鸣器 滴滴_关于单片机驱动蜂鸣器发出滴滴的声音的程序怎么写...
最新推荐文章于 2024-05-15 10:01:21 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)