当前位置:网站首页>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输出频率,生成不同的声音(旋律)。配置如下:
边栏推荐
- STM32F411 SPI2输出错误,PB15无脉冲调试记录【最后发现PB15与PB14短路】
- 【一天学awk】条件与循环
- Returning to the top of the list, the ID is still weak
- Qt+pcl Chapter 6 point cloud registration ICP series 3
- vim 从嫌弃到依赖(22)——自动补全
- TensorFlow團隊:我們沒被拋弃
- ATSS:自动选择样本,消除Anchor based和Anchor free物体检测方法之间的差别
- 【OpenCV 例程200篇】216. 绘制多段线和多边形
- 6.2 normalization 6.2.6 BC normal form (BCNF) 6.2.9 normalization summary
- ABAP-调用Restful API
猜你喜欢
[video memory optimization] deep learning video memory optimization method
MySQL backup and restore single database and single table
Gaussdb (for MySQL):partial result cache, which accelerates the operator by caching intermediate results
HR面试:最常见的面试问题和技巧性答复
For the sustainable development of software testing, we must learn to knock code?
求求你们,别再刷 Star 了!这跟“爱国”没关系!
STM32ADC模拟/数字转换详解
工厂高精度定位管理系统,数字化安全生产管理
厦门灌口镇田头村特色农产品 甜头村特色农产品蚂蚁新村7.1答案
Photoshop插件-HDR(二)-脚本开发-PS插件
随机推荐
For the sustainable development of software testing, we must learn to knock code?
Can I choose to open an account on Great Wall Securities? Is it safe?
Zhang Chi's class: several types and differences of Six Sigma data
Qt+pcl Chapter 6 point cloud registration ICP Series 2
Phpcms background upload picture button cannot be clicked
6.2 normalization 6.2.6 BC normal form (BCNF) 6.2.9 normalization summary
Zhang Chi Consulting: household appliance enterprises use Six Sigma projects to reduce customers' unreasonable return cases
[video memory optimization] deep learning video memory optimization method
Research on manually triggering automatic decision of SAP CRM organization model with ABAP code
STM32F411 SPI2输出错误,PB15无脉冲调试记录【最后发现PB15与PB14短路】
Raytheon technology rushes to the Beijing stock exchange and plans to raise 540million yuan
Samsung took the lead in putting 3nm chips into production, and Shanghai's fresh master students can settle directly. Nankai has established a chip science center. Today, more big news is here
MySQL advanced 4
她就是那个「别人家的HR」|ONES 人物
[stm32-usb-msc problem help] stm32f411ceu6 (Weact) +w25q64+usb-msc flash uses SPI2 to read out only 520kb
Introduction to MySQL audit plug-in
Survey of intrusion detection systems:techniques, datasets and challenges
Gaussdb (for MySQL):partial result cache, which accelerates the operator by caching intermediate results
C#/VB.NET 合并PDF文档
点云重建方法汇总一(PCL-CGAL)