Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/256.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/unity3d/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 用C语言编程实现微光三维传感器_C#_Unity3d - Fatal编程技术网

C# 用C语言编程实现微光三维传感器

C# 用C语言编程实现微光三维传感器,c#,unity3d,C#,Unity3d,我目前正在启动一个Unity项目,它使用来自Shimmer Sensor的一些传感器。 我无法正确启动我的项目,因为我没有足够的关于他们的C API的文档 所以我想找一个人,他可以分享一个用这种传感器制作的项目,至少是初始化部分和连接 我的代码: Shimmer Shim = new Shimmer ("Shimmer3-8615","COM6");//Initialise the sensor for the connection ObjectCluster Test = new Object

我目前正在启动一个Unity项目,它使用来自Shimmer Sensor的一些传感器。 我无法正确启动我的项目,因为我没有足够的关于他们的C API的文档

所以我想找一个人,他可以分享一个用这种传感器制作的项目,至少是初始化部分和连接

我的代码:

Shimmer Shim = new Shimmer ("Shimmer3-8615","COM6");//Initialise the sensor for the connection
ObjectCluster Test = new ObjectCluster ("COM6","Shimmer3-8615");//Contain the Data from the sensor

public float speed;

void Awake ()//Launch when the programme start
{
    Shim.Connect ();//Connect the object to the sensor with bluetooth
}

void FixedUpdate ()//Start whenever he receive data
{
    float movehorizontal;
    float movevertical;
    movehorizontal = float.Parse((Test.GetData("Low Noise Accelerometer X", "RAW")).GetData().ToString());
    movevertical = float.Parse((Test.GetData("Low Noise Accelerometer Y", "RAW")).GetData().ToString());//Input.GetAxis ("Vertical")
    float up = float.Parse((Test.GetData("Low Noise Accelerometer Z", "RAW")).GetData().ToString());//0.0f

    Vector3 mouvement = new Vector3 (movehorizontal,up,movevertical);
    rigidbody.AddForce (mouvement * speed *Time.deltaTime);

}
当.connect自身执行时,我得到一个空对象异常。 通过COM端口6上的蓝牙进行连接