获取单个超声波传感器数据处理
| .idea | ||
| app | ||
| docs | ||
| tests | ||
| README.md | ||
| requirements.txt | ||
| run.py | ||
Python 获取超声波传感器数据
简介
该仓库为超声波传感器数据的获取(TTL串口通信数据),该超声波有 6 种工作模式,代码中只使用模式1/2 ,两种模式足以
运行方式:
# 安装依赖
pip install -r requirements.txt
# 直接运行 run.py 为默认模式(模式1)
python run.py
# 带参数说明:
python run.py -m 1
# usage: run.py [-h] [-m {1,2}]
# optional arguments:
# -h, --help show this help message and exit
# -m {1,2}, --mode {1,2} 选择模式(1或2),默认为1
项目结构:
ultrasonic_ttl> tree /f
│ README.md
│ requirements.txt
│ run.py
│
├─.idea
│ │ .gitignore
│ │ misc.xml
│ │ modules.xml
│ │ python_code.iml
│ │ vcs.xml
│
├─docs
│ JSN-SR04T-V3.0带线款说明书中性.pdf
│ JSN超声波Demo2.0.rar
│
└─tests
test.py
使用设备
https://item.taobao.com/item.htm?id=42087449148
说明和上位机
├─docs │ JSN-SR04T-V3.0带线款说明书中性.pdf │ JSN超声波Demo2.0.rar