当前位置:网站首页>Use Proteus to simulate STM32 ultrasonic srf04 ranging! Code+Proteus
Use Proteus to simulate STM32 ultrasonic srf04 ranging! Code+Proteus
2022-04-23 13:00:00 【Outside Jinguan City】
This post uses Proteus8.10, If the lower version cannot be opened, it can be drawn according to the schematic diagram ( It's simple )
The model of single chip microcomputer is :stm32f103 series
Use timer3. Stable operation , There is a deviation in the indication distance , Can be changed at the source .
If there is a problem , Comment area , See back ~


#include "sys.h"
#include "delay.h"
#include "led.h"
#include "key.h"
#include "timer.h"
int main(void)
{
float SRF04_Value = 123.45;
uint8_t adcxxx[3] = {
0, 0, 0};
HAL_Init();
Stm32_Clock_Init(RCC_PLL_MUL9);
delay_init(72);
LCD_init();
SRF04_init();
TIM3_Init(1000-1, 72-1);
while(1)
{
SRF04_Value = Hcsr04GetLength();
adcxxx[0] = (uint16_t)SRF04_Value / 100 + 48;
adcxxx[1] = (uint16_t)SRF04_Value % 100 / 10 + 48;
adcxxx[2] = (uint16_t)SRF04_Value % 100 % 10 + 48;
LCD_write_string(1, 0, "Distance:");
LCD_write_string(11, 0, (char*)adcxxx);
}
}
版权声明
本文为[Outside Jinguan City]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230613382885.html
边栏推荐
- Important knowledge of transport layer (interview, retest, final)
- Install nngraph
- V-model binding value in El select, data echo only displays value, not label
- unity常见的问题(一)
- 4.DRF 权限&访问频率&过滤&排序
- 云原生KubeSphere部署Mysql
- 精度、速度完美平衡,最新图像分割SOTA模型重磅发布!!!
- Summary of JVM knowledge points - continuously updated
- The El table horizontal scroll bar is fixed at the bottom of the visual window
- [vulnhub range] - DC2
猜你喜欢

Unable to create servlet under SRC subfile of idea

Free and open source charging pile Internet of things cloud platform

How to click an object to play an animation

拥抱机器视觉新蓝海,冀为好望开启数字经济发展新“冀”遇

22. Bracket generation

5 free audio material websites, recommended collection

There is no need to crack the markdown editing tool typora

Homomorphic encryption technology learning
![[vulnhub range] - DC2](/img/b7/c34f69a231dad653b8a912f1f36bef.png)
[vulnhub range] - DC2

XinChaCha Trust SSL Organization Validated
随机推荐
Go language slicing operation
8 websites that should be known for product development to enhance work experience
XinChaCha Trust SSL Organization Validated
decast id.var measure.var数据拆分与合并
SQL exercise question 1
Aviation core technology sharing | overview of safety characteristics of acm32 MCU
云原生KubeSphere部署Redis
Free and open source agricultural Internet of things cloud platform (version: 3.0.1)
leetcode-791. Custom string sorting
将opencv 图片转换为字节的方式
Packet capturing and sorting -- TCP protocol [8]
Unlock openharmony technology day! The annual event is about to open!
Homomorphic encryption technology learning
Summary of JVM knowledge points - continuously updated
R语言中dcast 和 melt的使用 简单易懂
软件测试周刊(第68期):解决棘手问题的最上乘方法是:静观其变,顺水推舟。
STM32 control stepper motor (ULN2003 + 28byj)
5 free audio material websites, recommended collection
SSM框架系列——数据源配置day2-1
Install nngraph