当前位置:网站首页>STM32F1与STM32CubeIDE编程实例-PWM驱动蜂鸣器生产旋律
STM32F1与STM32CubeIDE编程实例-PWM驱动蜂鸣器生产旋律
2022-07-01 15:41:00 【视觉智能】
PWM驱动蜂鸣器生产旋律
蜂鸣器或蜂鸣器是一种音频信号装置, 可以是机械的、机电的或压电的(简称压电)。其主要功能是将信号从音频转换为声音。 一般通过直流电压供电,用于定时器、报警器、打印机、报警器、电脑等。根据不同的设计,它可以产生不同的声音,如闹钟、音乐、铃声和警笛。
蜂鸣器又分为有源蜂鸣器和无源蜂鸣器。本次实例使用无源蜂鸣器,如上图所示。
1、蜂鸣器配置
开发环境搭建、系统时钟配置、调试配置及串口配置,请参考:
- STM32F1与STM32CubeIDE快速入门-开发环境搭建
- STM32F1与STM32CubeIDE快速入门-GPIO概述与点亮LED
- STM32F1与STM32CubeIDE快速入门-USART/UART串口通信
本次实例通过定时器的PWM功能驱动蜂鸣器。通过指定PWM输出时间长短和调整PWM输出频率,生成不同的声音(旋律)。配置如下:
边栏推荐
- 【一天学awk】条件与循环
- 《QT+PCL第六章》点云配准icp系列5
- 说明 | 华为云云商店「商品推荐榜」
- 药品溯源夯实安全大堤
- 【Pygame实战】你说神奇不神奇?吃豆人+切水果结合出一款你没玩过的新游戏!(附源码)
- Zhang Chi's class: several types and differences of Six Sigma data
- 点云重建方法汇总一(PCL-CGAL)
- 【OpenCV 例程200篇】216. 绘制多段线和多边形
- Tableapi & SQL and MySQL grouping statistics of Flink
- Tiantou village, Guankou Town, Xiamen special agricultural products Tiantou Village special agricultural products ant new village 7.1 answer
猜你喜欢
【一天学awk】函数与自定义函数
Skywalking 6.4 distributed link tracking usage notes
Zhang Chi's class: several types and differences of Six Sigma data
《QT+PCL第六章》点云配准icp系列6
Summary of point cloud reconstruction methods I (pcl-cgal)
求求你们,别再刷 Star 了!这跟“爱国”没关系!
重回榜首的大众,ID依然乏力
【STM32学习】 基于STM32 USB存储设备的w25qxx自动判断容量检测
综述 | 激光与视觉融合SLAM
[target tracking] |stark
随机推荐
[one day learning awk] function and user-defined function
采集数据工具推荐,以及采集数据列表详细图解流程
Detailed explanation of stm32adc analog / digital conversion
Redis秒杀demo
6.2 normalization 6.2.6 BC normal form (BCNF) 6.2.9 normalization summary
Implementation of wechat web page subscription message
Wechat applet 02 - Implementation of rotation map and picture click jump
摩根大通期货开户安全吗?摩根大通期货公司开户方法是什么?
硬件开发笔记(九): 硬件开发基本流程,制作一个USB转RS232的模块(八):创建asm1117-3.3V封装库并关联原理图元器件
微信小程序03-文字一左一右显示,行内块元素居中
The newly born robot dog can walk by himself after rolling for an hour. The latest achievement of Wu Enda's eldest disciple
S32K1xx 微控制器的硬件設計指南
使用swiper制作手机端轮播图
Raytheon technology rushes to the Beijing stock exchange and plans to raise 540million yuan
Can I choose to open an account on Great Wall Securities? Is it safe?
The last picture is seamlessly connected with the first picture in the swiper rotation picture
《QT+PCL第六章》点云配准icp系列3
《QT+PCL第六章》点云配准icp系列5
C#/VB.NET 合并PDF文档
Lean Six Sigma project counseling: centralized counseling and point-to-point counseling