How to send a string from Arduino to a Hololens game via Bluetooth?

Hello,

I have been working on a game that involves sending a string of text over Bluetooth from an Arduino Uno Rev 3 to the game.

Up till now, I had been doing all the testing in the editor, and retrieving the string of text by using Uniduino.

Unfortunately, Uniduino uses the System.IO.Ports namespace, which isn’t available on the Windows Store App platform. Thus, when I try to Build my game for deployment to the Hololens device, rather then testing in the editor, i get the error “The type or namespace name ‘SerialPort’ could not be found”.

Has anybody been able to read data from Bluetooth in their Hololens / Windows Store App game?

Any help is appreciated,

Thanks

This might be of help, this was part of a thread on another form. This is using gps from a phone, but I think it is close to what you are asking for.

Link:
https://www.gamedev.net/resources/_/technical/virtual-and-augmented-reality/gps-on-the-microsoft-hololens-r4497

Unity Thread:

@Hodgson_SDAS might have more information.

Hope this helps

1 Like

Thanks, I’ll look that article over. Might be too advanced for me to understand what’s going on but i’ll give it a shot.

@Unity_Wesley I’d have probably pointed to that article myself haha.

You did in the forum post linked above, making sure to give credit were credit is due. :slight_smile:

Ok, I think that post got me on the right track. I managed to get a non-Unity app on the Hololens read the BLE data.

The tutorial I followed is found here: www.simplicity.be (blog), and the code for it found on GitHub here. I’m using an Arduino Mega 2560 and a RedBearLab BLE Shield.

The problem I am having now is that I don’t know how to translate that tutorial into Unity.

Mainly, I think the issue is that the example uses the UniversalBeaconLibrary and I don’t know how to allow my Unity WSA to use that library.

Any ideas?

Thanks.

1 Like

Here is the documentation on plugins

You need to add the dll to your project, and have a separate folders for each platform you want to have. Example is a plugins folder then inside that folder have editor, x86, etc… then have a copy of the dll with the proper settings for each platform inside those folders.

Here is an example pic
2992301--222837--upload_2017-3-13_14-45-42.png

1 Like

That did the trick!

Thanks for your help!

Your Welcome! :slight_smile: