我试图连接一个LED与Windows手机10,一个HC-05蓝牙模块和一个Arduino Uno。我只是不能让LED响应时,使用蓝牙模块,只有当直接连接槽USB。
HC-05使用密码,我只是找不到如何在API上传递密码。
我在上使用的代码是:
//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);
}发布于 2015-12-01 07:06:47
如果发现问题,则无论是在firmata还是在Visual上,波特率都必须为9600:
在arduino的setup()函数上:
Firmata.begin(9600);在代码的开始部分:
connection.begin(9600, SerialConfig.SERIAL_8N1);https://stackoverflow.com/questions/34011987
复制相似问题