如何在Windows phone 8.1中通过蓝牙连接发送字符

How to send a char through Bluetooth connection in Windows phone 8.1

本文关键字:连接 接发 字符 Windows phone      更新时间:2023-10-16

去年我用Android和Arduino做了一个项目。我可以从arduino发送一些字符。

现在我想知道我怎么能在Windows Phone 8.1?

我发现了很多关于它的东西,但不是我真正想要的,我只是想创建一个简单的按钮,并向我的Arduino发送消息!

这里是我的代码从c++ Arduino:

const int ledVermelho = 7;
char entrada;
void setup() {
   Serial.begin(9600);
   pinMode(ledVermelho,OUTPUT); 
}
void loop() {
    entrada = Serial.read();
    if (entrada == 'a') {
        digitalWrite(ledVermelho,HIGH);
    }
    if (entrada == 'b') {
        digitalWrite(ledVermelho,LOW);
    }
}

使用https://processing.org/和他的附加库"G4P",您可以轻松创建按钮。

在此之后,您可以按照以下指南连接Arduino和Processing: https://learn.sparkfun.com/tutorials/connecting-arduino-to-processing .

至少,你可以使用processingJS为你的windows phone创建应用程序(只需在谷歌上搜索处理windows phone,你会发现很多指南)。

或者至少,你可以使用windows phone应用程序"BT Terminal"来相互连接。但也许,这看起来太不专业了。