I am a student from Sun-Yat-sen University, China.I am trying to receive speed data from a magnet-less speed sensor in Unity.
Now, I have :
·a ant+ usb stick,
·a speed sensor,
·a x64 win10 PC
·some dll from the sdk
In the ANT+ SDK 3.5, I modify the c# sub-project "DEMO_NET" which is a c# console app and run , I can receive the speed data from my speed sensor. However, I use the same c# script in Unity, but it doesn't works, saying that
Demo failed with exception:
Could not connect to any device.
Arguments cannot be null
I found that the code below doesn't work, in Unity. The device0 here refers to the ANT+ USB STICK in c# sub-project "DEMO_NET", but in Unity, it's null.
device0 = new ANT_Device(); // Create a device instance using the automatic constructor (automatic detection of USB device number and baud rate)
Additonally, the Unity support .Net frame most up to 3.5, so I recompiled the source code in ANT+ SDK. And the needed .dll are placed in the same file， so they should refer each other.
Can somebody help me?
Some Threads in the Forum
the thread 6709 https://www.thisisant.com/forum/viewthread/6709/
says that, there is an unity ant+ asset called ANT+ FOR UNITY, in https://assetstore.unity.com/packages/tools/network/ant-for-unity-57137.But
it is unavailable now.
There is also a ant+ library in unity, call "Advanced ANT+", https://assetstore.unity.com/packages/tools/network/advanced-ant-71980
But i.t cost $60, which is too expansive to a student like me.I just develop ant+ with unity for learn instead of commerce.
The attchment is my unity project and the output scene.
ahhhhh, I uploaded the attachments, but can not found them in my post.， so I upload they in a cloud-disk, and share.
·the output scene in Unity https://pan.baidu.com/s/1A5eqd-A3CcFqEAgbtVOBDA
·PluginTest.rar: the unity project ：https://pan.baidu.com/s/19fdaDXXdKFXid4pgffba9g
if the page is in Chinese, click the button "下载(xxxKB)" for "download(xxxKB)".