Connect to exteral device? C++

This is probably not very relevant to ue4, but here is what I want to do:

Connect an accelerometer to my C++ UE4 project…

How would I do this?

I really need any help C++ pros can give.

Do you have a 64bits library to access your accelerometer?

If so, there are many posts here and on the forum for integration of an “external” dll to your project but to make it simple:

  1. Try everything in a standalone C++ project before trying to get it into an UE project.
  2. Locate the 64 bits dll and lib files that you need
  3. Put your DLLs an lib in the YouProject/Binaries/Win64 folder
  4. Modify the file build.cs, to advise Unreal of the location

// in build.cs

PublicAdditionalLibraries.Add(@“c:/YourProject/Binaries/Win64/YourLib.lib”);

Use your .h and .cpp like in any other project. But try to put the #include of the external library in your .cpp to avoid conflicts with the zillions of Unreal #include.