我有一个通过驱动程序“ USB-SERIAL CH340”连接到Windows的陀螺仪。
它给了我一些测量参数,例如角度,角速度。
我想编写一个使我的陀螺仪真正的鼠标驱动程序:
对于Windows(Windows 8或更高版本)完全类似于鼠标设备
检索测量的参数并相应地设置鼠标坐标
该怎么办?谢谢!
C#参考代码:
this.components = new System.ComponentModel.Container();
this.spSerialPort = new System.IO.Ports.SerialPort(this.components);
...
private void SerialPort_DataReceived(object sender,System.IO.Ports.SerialDataReceivedEventArgs e)
{
...
usLength = (UInt16)spSerialPort.Read(RxBuffer,usRxLength,700);
...
}