510
个编辑
更改
→实验准备
=== 硬件设计 ===
选择STM32L4引脚PC6用来捕获红外传感器HS0038的DATA引脚输出的PWM波。''<span class="tlid-translation-gender-indicator translation-gender-indicator"></span>''选择STM32L4引脚PC6用来捕获''<span class="tlid-translation-gender-indicator translation-gender-indicator"></span>''红外传感器HS0038的DATA引脚输出的PWM波。[[文件:NBDK-SCH-IR.png|边框|居中|无框|393x393像素|''<span class="tlid-translation-gender-indicator translation-gender-indicator"></span>'']]''<span class="tlid-translation-gender-indicator translation-gender-indicator"></span><span class="tlid-translation-gender-indicator translation-gender-indicator"></span><span class="tlid-translation-gender-indicator translation-gender-indicator"></span><span class="tlid-translation-gender-indicator translation-gender-indicator"></span><span class="tlid-translation-gender-indicator translation-gender-indicator"></span><span class="tlid-translation-gender-indicator translation-gender-indicator"></span><span class="tlid-translation-gender-indicator translation-gender-indicator"></span><span class="tlid-translation-gender-indicator translation-gender-indicator"></span>''
=== 实验准备 ===
=== 实验验证 ===
下载完成后,我们按下遥控器上的任意按键,可以看到LCD上将显示如下,irBtnVal代表的是键值,irBtnCnt代表是按键被按下的次数,irBtnInfo代表按键的图标或者定义。
==== stm32l4xx_hal_conf.h ====
此例程我们主要给大家展示STM32L4的I2C功能,所以我们宏定义中打开I2C相关的。<syntaxhighlight lang="c" line="1" start="103">