当前位置:网站首页>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输出频率,生成不同的声音(旋律)。配置如下:
边栏推荐
- Tensorflow team: we haven't been abandoned
- Summary of week 22-06-26
- Raytheon technology rushes to the Beijing stock exchange and plans to raise 540million yuan
- Photoshop plug-in HDR (II) - script development PS plug-in
- 摩根大通期货开户安全吗?摩根大通期货公司开户方法是什么?
- Hardware design guide for s32k1xx microcontroller
- [target tracking] | template update time context information (updatenet) "learning the model update for Siamese trackers"
- 华为发布HCSP-Solution-5G Security人才认证,助力5G安全人才生态建设
- Qt+pcl Chapter 6 point cloud registration ICP Series 5
- S32K1xx 微控制器的硬件设计指南
猜你喜欢

【300+精选大厂面试题持续分享】大数据运维尖刀面试题专栏(三)
![[one day learning awk] function and user-defined function](/img/e1/a378211ef05fcc4d469363f3e509a7.png)
[one day learning awk] function and user-defined function
![[one day learning awk] conditions and cycles](/img/e6/c96a4fd6ced9b492e70a06004f5159.png)
[one day learning awk] conditions and cycles

你TM到底几点下班?!!!

《性能之巅第2版》阅读笔记(五)--file-system监测

Introduction to MySQL audit plug-in

Tensorflow team: we haven't been abandoned

Some abilities can't be learned from work. Look at this article, more than 90% of peers

STM32F411 SPI2输出错误,PB15无脉冲调试记录【最后发现PB15与PB14短路】

For the sustainable development of software testing, we must learn to knock code?
随机推荐
药品溯源夯实安全大堤
Zhang Chi Consulting: lead lithium battery into six sigma consulting to reduce battery capacity attenuation
将ABAP On-Premises系统连接到中央检查系统以进行自定义代码迁移
The newly born robot dog can walk by himself after rolling for an hour. The latest achievement of Wu Enda's eldest disciple
Lean Six Sigma project counseling: centralized counseling and point-to-point counseling
[antenna] [3] some shortcut keys of CST
说明 | 华为云云商店「商品推荐榜」
Tableapi & SQL and MySQL insert data of Flink
Go zero actual combat demo (I)
微信小程序02-轮播图实现与图片点击跳转
自动、智能、可视!深信服SSLO方案背后的八大设计
For the sustainable development of software testing, we must learn to knock code?
Tableapi & SQL and MySQL grouping statistics of Flink
Go语学习笔记 - gorm使用 - 表增删改查 | Web框架Gin(八)
[pyGame practice] do you think it's magical? Pac Man + cutting fruit combine to create a new game you haven't played! (source code attached)
[video memory optimization] deep learning video memory optimization method
七夕表白攻略:教你用自己的专业说情话,成功率100%,我只能帮你们到这里了啊~(程序员系列)
【Pygame实战】你说神奇不神奇?吃豆人+切水果结合出一款你没玩过的新游戏!(附源码)
【300+精选大厂面试题持续分享】大数据运维尖刀面试题专栏(三)
Qt+pcl Chapter 6 point cloud registration ICP series 3