WT925Helper.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Wit.SDK.Modular.Sensor.Utils
  7. {
  8. /// <summary>
  9. /// 9轴倾角传感器帮助类
  10. /// </summary>
  11. public class WT925Helper
  12. {
  13. /// <summary>
  14. /// 解锁命令
  15. /// </summary>
  16. /// <returns></returns>
  17. public static byte[] Unlock()
  18. {
  19. return WitProtocolUtils.GetWrite(0x69, 0xB588);
  20. }
  21. /// <summary>
  22. /// 加计校准
  23. /// </summary>
  24. /// <returns></returns>
  25. public static byte[] AccelerationCalibration()
  26. {
  27. return WitProtocolUtils.GetWrite(0x01, 0x01);
  28. }
  29. /// <summary>
  30. /// 开始磁场校准
  31. /// </summary>
  32. /// <returns></returns>
  33. public static byte[] BeginFieldCalibration()
  34. {
  35. return WitProtocolUtils.GetWrite(0x01, 0x07);
  36. }
  37. /// <summary>
  38. /// 结束磁场校准
  39. /// </summary>
  40. /// <returns></returns>
  41. public static byte[] EndFieldCalibration()
  42. {
  43. return WitProtocolUtils.GetWrite(0x01, 0x00);
  44. }
  45. /// <summary>
  46. /// 波特率调整
  47. /// </summary>
  48. /// <returns></returns>
  49. public static byte[] SetBaudRate(ushort value)
  50. {
  51. return WitProtocolUtils.GetWrite(0x04, value);
  52. }
  53. /// <summary>
  54. /// 设置输出内容
  55. /// </summary>
  56. /// <param name="value"></param>
  57. /// <returns></returns>
  58. public static byte[] SetBackContent(ushort value)
  59. {
  60. return WitProtocolUtils.GetWrite(0x02, value);
  61. }
  62. // 带宽调整
  63. // 量程调整
  64. // 滤波参数
  65. }
  66. }