图像缩略图

Arduino的Legacy HC-SR04附加库

versión 1.2.1 (85.7 KB) por Mathworks MATLAB硬件团队
与MATLAB中Arduino硬件连接的HC-SR04超声传感器的接口。

18,3K descargas

实际扎达2019年5月8日

Ver licencia

Nota del editor:

For R2019a and later, this functionality is included with theArduino万博1manbetx硬件的MATLAB支持包。的用户MATLABR2019a and later versions should not use this add-on library.

此附加库仅用于MATLAB R2016A到R2018B。

此附加组件由MATLAB R2万博1manbetx016A -R2018B支持。对于R2019A及以后,支持软件包包含此功能。万博1manbetx

此附加组件扩展了用于Arduino硬件的MATLAB支万博1manbetx持软件包,以读取HC-SR04超声传感器的距离测量值。使用此附加组件,您可以在米中读取距离,也可以在几秒钟内读取旅行时间,以更精确地计算距离。

示例用法:
-------------------------------
% Create arduino object with the add-on library
a = arduino('com38','uno','libraries','jrodrigotech/hcsr04');
%创建超声波对象
sensor = addon(a, 'JRodrigoTech/HCSR04', 'D12', 'D13');
%获得感应距离
dist = readdistance(传感器);

它包括文档和一个示例,该示例演示了与HC-SR04传感器一起使用以获得距离。

重要的是:在MATLAB中使用此附加库之前,您需要安装超声波Arduino库。这是说明:
1.从https://github.com/jrodrigotech/ultrasonic-hc-sr04/archive/master.zip
2.将拉链包装到本地目录中,然后将文件夹重命名为“超声波”。
3. Move the ‘Ultrasonic’ folder into the "libraries" folder inside your Arduino sketchbook folder:
在Windows上,默认路径是“我的文档\ arduino \ liberaries \”
在Mac上,默认路径为“〜/documents/arduino/libraries/”
在Linux上,默认路径为“/home//arduino/libraries”

故障排除提示:
1. After installing this add-on library and the required Arduino library, type "listArduinoLibraries" in MATLAB to see if the add-on is properly installed.
2.在创建对象之前,请正确地将Arduino板和附加设备连接起来,以避免MATLAB中的连接错误。
3.有关使用和语法的详细信息,请参阅文档。可以在产品文档中的补充软件下找到它。

Feel free to contact the MATLAB Hardware Team if you have questions about this add-on library:
//www.tianjin-qmedu.com/matlabcentral/profile/contact/4922363-mathworks-mathworks-matlab-hardware-wareware-team

Citar Como

Mathworks MATLAB硬件团队(2022).Arduino的Legacy HC-SR04附加库(//www.tianjin-qmedu.com/matlabcentral/fileexchange/57898-legacy-hc-sr04-add-ond-on-library-for-arduino),matlab中央文件交换。recuperado

Compatibilidad con la versión de MATLAB
SecreóConR2016A
Compatible con la versión R2016a a la R2018b
兼容
Windows 苹果系统 Linux

社区寻宝

在Matlab Central中找到宝藏,发现社区如何为您提供帮助!

Start Hunting!

+arduinoioaddons/+jrodrigotech