首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >windows 10和带有密码的蓝牙模块hc-05

windows 10和带有密码的蓝牙模块hc-05
EN

Stack Overflow用户
提问于 2015-12-01 03:17:12
回答 1查看 1.2K关注 0票数 0

我试图连接一个LED与Windows手机10,一个HC-05蓝牙模块和一个Arduino Uno。我只是不能让LED响应时,使用蓝牙模块,只有当直接连接槽USB。

HC-05使用密码,我只是找不到如何在API上传递密码。

我在上使用的代码是:

代码语言:javascript
复制
//on the constructor:
connection = new BluetoothSerial("HC-05");
arduino = new RemoteDevice(connection);
connection.ConnectionEstablished += onConnectionStablished;
connection.begin(38400, SerialConfig.SERIAL_8N1);

//on the buttons:
private void OnButton_Click(object sender, RoutedEventArgs e)
    {
        //turn the led on pin 5 on
        arduino.digitalWrite(9, PinState.HIGH);
    }
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-12-01 07:06:47

如果发现问题,则无论是在firmata还是在Visual上,波特率都必须为9600:

在arduino的setup()函数上:

代码语言:javascript
复制
    Firmata.begin(9600);

在代码的开始部分:

代码语言:javascript
复制
    connection.begin(9600, SerialConfig.SERIAL_8N1);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34011987

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档