当前位置:网站首页>Three channel ultrasonic ranging system based on 51 single chip microcomputer (timer ranging)
Three channel ultrasonic ranging system based on 51 single chip microcomputer (timer ranging)
2022-04-23 13:00:00 【Outside Jinguan City】
Functional specifications :
be based on 51 Three way of MCU ( Can be more )HCSR04、US100(io Pattern ) Ultrasonic ranging code
matters needing attention :
processor :STC89C51/STC89C52
display :LCD1602
ultrasonic :HCSR04、US100(io Pattern )
The key task interface is reserved for users to use
Chinese notes of relevant pin connection :
#include<reg52.h>
#include <intrins.h>
#define uint unsigned int
#define uchar unsigned char
//--- Definition lcd1602 The use of IO mouth ---//
#define LCD_DATA P0
sbit RS=P2^7;
sbit RW=P2^6;
sbit EN=P2^5;
//--- Definition Key The use of IO mouth ---//
sbit key1=P1^5;
sbit key2=P1^6;
sbit key3=P1^7;
//--- Definition led The use of IO mouth ---//
sbit led=P2^1;
//HCSR04/US100 Ultrasonic interface
sbit Trig1 = P2^0;
sbit Echo1 = P2^1;
sbit Trig2 = P2^2;
sbit Echo2 = P2^3;
sbit Trig3 = P3^7;
sbit Echo3 = P3^6;
Main function program :
void
main()
{
lcd_init(); //1602 initialization
Timer_Init(); // Initialize the timer
while(1) // Cyclic reading And update the data display
{
key_scan(); // Scan button ( reserve )
get_distance(1); // Computational ultrasound 1 distance
dis_str(0,0,"US1:");dis_shu(4,0,distance1); // ultrasonic 1 Distance display
get_distance(2); // Computational ultrasound 2 distance
dis_str(0,1,"US2:");dis_shu(4,1,distance2); // ultrasonic 2 Distance display
get_distance(3); // Computational ultrasound 3 distance
dis_str(9,1,"US3:");dis_shu(13,1,distance3);// ultrasonic 3 Distance display
}
}
See the comments section for links to all the information , Please leave a message if you have any questions ~
author :amusen
Time :2022.4
I wish good !
版权声明
本文为[Outside Jinguan City]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230613382608.html
边栏推荐
- Use compressorjs to compress pictures, optimize functions, and compress pictures in all formats
- Softbank vision fund entered the Web3 security industry and led a new round of investment of US $60 million in certik
- Go language array operation
- leetcode:437. 路径总和 III【dfs 选还是不选?】
- R语言中dcast 和 melt的使用 简单易懂
- Baserecyclerviewadapterhelper realizes pull-down refresh and pull-up loading
- Wonderful review | the sixth issue of "source" - open source economy and industrial investment
- unity常见的问题(一)
- 将新增和编辑的数据同步更新到列表
- 软件测试周刊(第68期):解决棘手问题的最上乘方法是:静观其变,顺水推舟。
猜你喜欢

STM32 control stepper motor (ULN2003 + 28byj)

风尚云网学习-input属性总结

World Book Day: I'd like to recommend these books

云原生KubeSphere部署Mysql

Remote sensing image classification and recognition system based on convolutional neural network
![[Blue Bridge Cup] April 17 provincial competition brushing training (the first three questions)](/img/7d/23e2a611bc6a0d0239abdc79e2e8cf.png)
[Blue Bridge Cup] April 17 provincial competition brushing training (the first three questions)

Record Alibaba cloud server mining program processing

Use source insight to view and edit source code

Bert base Chinese Download (SMART)

世界读书日:我想推荐这几本书
随机推荐
mysql支持ip访问
7_Addmodule和基因加和法add 得到的细胞类型打分在空间上空转对比
Jiachen chapter Genesis "inner universe" joint Edition
HQL find the maximum value in a range
JDBC connection pool
BaseRecyclerViewAdapterHelper 实现下拉刷新和上拉加载
Golang implements MD5, sha256 and bcrypt encryption
梳理網絡IP代理的幾大用途
SSL certificate refund instructions
The El table horizontal scroll bar is fixed at the bottom of the visual window
在线计算过往日期天数,计算活了多少天
梳理网络IP代理的几大用途
Software testing weekly (issue 68): the best way to solve difficult problems is to wait and see the changes and push the boat with the current.
Introduction to servlet listener & filter
leetcode:437. 路径总和 III【dfs 选还是不选?】
风尚云网学习-h5的input:type属性的image属性
MySQL supports IP access
leetcode-791. Custom string sorting
Introducing vant components on demand
Aviation core technology sharing | overview of safety characteristics of acm32 MCU