简体   繁体   English

使用 MIT App Inventor 2 扫描蓝牙设备

[英]Scaning for bluetooth device with MIT App Inventor 2

I am trying to connect an arduino has bluetooh(HC-06) with an android phone.我正在尝试将带有蓝牙(HC-06)的 arduino 与 android 手机连接。 I found and applied below block but I can only connect to paired devices without scanning.我在块下方找到并应用,但我只能连接到配对设备而无需扫描。

How can I scan for available bluetooth devices and connect them using MIT App Inventor 2?如何使用 MIT App Inventor 2 扫描可用的蓝牙设备并连接它们? What should be the block for scan operation?扫描操作的块应该是什么?

在此处输入图片说明

See the documentation of the bluetooth component查看蓝牙组件文档

As you can see, there is no block available to scan for devices, you only can get a list of paired Bluetooth devices ....如您所见,没有可用于扫描设备的块,您只能获取已配对蓝牙设备的列表......

AddressesAndNames地址和名称
The addresses and names of paired Bluetooth devices配对蓝牙设备的地址和名称

However you can create your own extension and create your own blocks, for more information, see the announcement here .但是,您可以创建自己的扩展并创建自己的块,有关更多信息, 请参阅此处的公告

Btw... see the following screenshot for how to connect correctly顺便说一句...有关如何正确连接,请参阅以下屏幕截图在此处输入图片说明

EDIT: to scan for devices you can use the classic bluetooth extension .编辑:要扫描设备,您可以使用经典蓝牙扩展
Note: I'm the author of that extension.注意:我是该扩展的作者。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM