当前位置:网站首页>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
边栏推荐
- Trier les principales utilisations de l'Agent IP réseau
- Kubernetes 入门教程
- World Book Day: I'd like to recommend these books
- Byte warehouse intern interview SQL questions
- XinChaCha Trust SSL Organization Validated
- Connect orcale
- Jiachen chapter Genesis "inner universe" joint Edition
- [vulnhub range] - DC2
- Bert base Chinese Download (SMART)
- melt reshape decast 长数据短数据 长短转化 数据清洗 行列转化
猜你喜欢
Navicat远程连接数据库 出现 1130- Host xxx is not allowed to connect to this MySQL server错误
如何实现点击一下物体播放一次动画
内核错误: No rule to make target ‘debian/canonical-certs.pem‘, needed by ‘certs/x509_certificate_list‘
leetcode:437. 路径总和 III【dfs 选还是不选?】
Kubernetes 入门教程
Can I take the CPDA data analyst certificate for 0 foundation
[csnote] ER diagram
melt reshape decast 长数据短数据 长短转化 数据清洗 行列转化
1130 - host XXX is not allowed to connect to this MySQL server error in Navicat remote connection database
安装nngraph
随机推荐
Use of Presto date function
将opencv 图片转换为字节的方式
SSL certificate refund instructions
XinChaCha Trust SSL Organization Validated
安装nngraph
Ad20 supplementary note 3 - shortcut key + continuous update
decast id.var measure.var数据拆分与合并
Record Alibaba cloud server mining program processing
Get the punch in record of nailing attendance machine
Byte jump 2020 autumn recruitment programming question: quickly find your own ranking according to the job number
产品开发都应该知道的8个网站,增强工作体验
在线计算过往日期天数,计算活了多少天
Golang implements a five insurance and one gold calculator with web interface
(个人)最近项目开发后存在的系统漏洞整理
melt reshape decast 长数据短数据 长短转化 数据清洗 行列转化
将新增和编辑的数据同步更新到列表
R语言中dcast 和 melt的使用 简单易懂
梳理網絡IP代理的幾大用途
Can I take the CPDA data analyst certificate for 0 foundation
Baserecyclerviewadapterhelper realizes pull-down refresh and pull-up loading