Git Product home page Git Product logo

blewinrtdll's Introduction

Unity project with BleWinrtDll configured for HoloLens 2 + Arduino BLE code

To try it out in Unity, open the project "BleWinrtDll Unity" in Unity. Then start the scene "Assets/Scenes/Demo.scene". To test on HoloLens, build as you would from Unity project. Also Arduino code included.

My goal was to send data from Arduino to HoloLens 2 through BLE created in Unity Engine.

This repo is forked from https://github.com/adabru/BleWinrtDll, where the Dll is configured to work with UWP Unity. It worked well with Arduino and Unity Editor, but did not translate well to HoloLens. So I include here adjusted Unity Project ready to be built to HoloLens together with Arduino sketch used. For more information check out the original repo: https://github.com/adabru/BleWinrtDll

alt text alt text
Menu showing in HoloLens 2 After clicking "Scan", it automatically connects to the described device and characteristic

Clicking "Write" will send 0, 1, 2 or 3 at random to Arduino. It will change colours according to the number.

The Demo.scene in this repo uses threads, the script is taken from BleWinrtDll-Unity-Demo.

Used

  • Windows 10
  • Arduino Nano 33 BLE
  • Arduino IDE 2.0.0-rc3
  • HoloLens 2
  • Unity Engine 2020.3.20f1
  • Visual Studio 2019 16.11.9 with packages installed (.NET desktop development, Desktop development with C++, Universal Windows Platform development)

Build

Arduino Nano BLE

Arduino Code is included in ArduinoCode -> bleledgesture.ino. Build it as you would the usual sketch. For the code to start running, you have to have the Serial Monitor open: alt text

HoloLens 2 Application

Build it as you would the usual application, you can follow the guide from Microsoft.

Updating Dll

You can follow instructions in the original repository. The difference now is that you need two Dlls, one for Unity Editor and one for HoloLens. For HoloLens choose configuration "Release" and "ARM64" and "x64" for Unity Editor when building. Rename the Dll for Unity Editor to "BleWinrtDllx64" and replace them in the Unity project Assets folder. You might have to reconfigure the Dlls in Unity. To do so click on the Dll and choose configurations shown in images:

alt text alt text
Editor Hololens

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.