简体   繁体   English

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

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

Last year i did one project with Android and Arduino. 去年,我用Android和Arduino做过一个项目。 Where I could send some characters android from arduino. 我可以从arduino发送一些字符android。

Now i want to know how can i do in Windows Phone 8.1? 现在我想知道如何在Windows Phone 8.1中进行操作?

I found a lot of stuffs about it, but not what i really want, I just wish to create a simple button and send a message to my Arduino! 我发现了很多东西,但不是我真正想要的东西,我只想创建一个简单的按钮并向Arduino发送消息!

heres my code from C++ 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);
    }
}

With https://processing.org/ and his additional library "G4P" you could create buttons easily. 使用https://processing.org/及其附加库“ G4P”,您可以轻松创建按钮。

After this, you could connect Arduino and Processing following this guide: https://learn.sparkfun.com/tutorials/connecting-arduino-to-processing . 之后,您可以按照以下指南连接Arduino和Processing: https : //learn.sparkfun.com/tutorials/connecting-arduino-to-processing

At least, you could use processingJS to create the app for your windows phone (just search processing windows phone on google and you will find a lot of guide). 至少,您可以使用processingJS为Windows Phone创建应用程序(只需在Google上搜索处理Windows Phone,您会发现很多指南)。

Or at least, you could just use the windows phone app "BT Terminal" to connect each other. 或者至少,您可以只使用Windows Phone应用程序“ BT终端”相互连接。 But maybe, it seems to be too much unprofessional. 但是也许,这似乎太不专业了。

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

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