当前位置:网站首页>Chapter 4 stm32+ld3320+syn6288+dht11 realize voice acquisition of temperature and humidity values (Part 2)
Chapter 4 stm32+ld3320+syn6288+dht11 realize voice acquisition of temperature and humidity values (Part 2)
2022-07-16 06:54:00 【Bi sheda escape】
The previous chapter will SYN6288 Code migration into LD3320 In the code of , Realize voice human-computer interaction , Next, I will teach you DHT11 The code is also transplanted into the code of voice human-computer interaction in the previous chapter , such STM32 I can get it DHT11 Collected temperature and humidity data , The rest is in User_Modification( ) In function correspondence “ What is the current temperature ” and “ What is the current humidity ” Of case Call down SYN_FrameInfo() Function broadcast temperature and humidity .
Open the transplanted voice human-computer interaction project file and DHT11 Engineering documents of ,DHT11 And STM32 They communicate with each other through a single bus , So we transplant the single bus driver source code file to the voice human-computer interaction engineering file .

After transplanting the single bus source code file , We can STM32 Function code files for obtaining temperature and humidity are also transplanted . however DHT11 The code project combines the single bus driver source code with STM32 The function code for obtaining temperature and humidity is integrated and transplanted DHT11 It's in the document , So for file migration, just complete the operations in the above figure .
Next, open the code of voice human-computer interaction , Proceed as shown in the figure below , Connect single bus drive and STM32 Get the function code of temperature and humidity and add it to the project .


Will be transplanted DHT11 Add the file to the compilation path .( Students who don't know how to add , Refer to the previous chapter )

Finish the above operation , We can call DHT11.c Inside the function , First, in the voice human-computer interaction code main.c Add... At the beginning DHT11.h The header file ( The first 1 Arrows indicate ), And copy the array storing temperature and humidity values ( The first 2 Arrows indicate ), And then call DHT11 Initialized function ( The first 3 Arrows indicate , dependent GPIO Initialization is also inside ).

Initialization complete DHT11 after , We can call where we need to broadcast the temperature Read_DHT_Data(wendu, shidu) take DHT11 The obtained temperature and humidity array is stored in wendu and shidu In the array , Give the array data to SYN_FrameInfo() The voice broadcast interface can broadcast the temperature and humidity array , As shown below ( In different operations according to different identification codes User_Modification( ) Add our broadcast voice operation in the function ).

Tempconverspeech() Function called SYN_FrameInfo() The voice broadcast interface broadcasts temperature and humidity data , As for how to call , You can download the code to check , The three parameters are Storage temperature data array name ( Address for storing temperature data )、 Store humidity data array name ( Address for storing humidity data ) And broadcast to (0x01: Broadcast temperature ,0x02: Broadcast humidity ).
After all the picture operations , Burn the code into STM32 in , The effect can be achieved .
The data link :https://pan.baidu.com/s/1j2XOTZn-v361OdQ_IK1vtw
Extraction code :9zaq

边栏推荐
猜你喜欢

IIC communication
![[introduction to go language] 10 go language map details](/img/ac/dde4a9aac8de9b4e364eb9322945b4.png)
[introduction to go language] 10 go language map details

ROS communication mechanism

四舍五入,向下取整,向上取整的使用
![[Multisim] problems that must be paid attention to when using ne5532p series operational amplifier simulation](/img/16/496c26d87407cc8e67182f209fe70b.png)
[Multisim] problems that must be paid attention to when using ne5532p series operational amplifier simulation

Download and burn raspberry pie system image

SSM整合(借鉴版)

Chapter II use of syn6288 speech synthesis module

Spark入门

Excel-1
随机推荐
SQL基础1
Vscode automatically adds comments
在Colab上训练yolov3(一)
obsidian第三方插件无法加载
#导入Word文档图片# 根文件系统制作与挂载
Notice on the completion of Internet of things
C language to realize Hanoi Tower (detailed explanation of program execution steps)
Experience of using voice chip jq8400
Pagoda panel creates multiple port deployment projects under the same server (lightweight application server one click deployment website, blog, gltlab full version)
Customize and modify the width and height of the van button in the van weap component library
Using idea IntelliJ to view bytecode files
使用MessageBox实现窗口表白小程序(附带源码)
Théorie de la distribution
STM32 uses a simple method to control many lights to achieve the effect of flowing water
[introduction to go language] 09 detailed explanation of go language slice
[Go语言入门] 05 Go语言分支语句
Comparison and application of DHT11 and dht22 (am2302)
SQL basics 1
[Go语言入门] 09 Go语言切片详解
[signal conditioning] ADC protection circuit /adc buffer