public SerialBnoUpdater(int sigFigs = 4, int delay = 30000) { _bnoSensor = new SerialBno(SerialPorts.COM3, 5000, 5000, SerialBno.Bno055OpMode.OperationModeNdof); _dataArray = new byte[_dataCount + _metaDataCount + _timeDataCount]; _dataArray[0] = (byte)PacketType.StartByte; // start bit = 0xff _dataArray[1] = (byte)PacketType.BnoDump; _delay = delay; _precision = (int)System.Math.Pow(10, sigFigs - 1); _workItem = new WorkItem(BnoUpdater, ref _dataArray, loggable: true, persistent: true, pauseable: true); _bnoSensor.Begin(); }
public SerialBnoUpdater(SerialBno bno, int sigFigs = 3, int delay = 30000) { _bnoSensor = bno; _dataArray = new byte[_dataCount + _metaDataCount + _timeDataCount]; _dataArray[0] = (byte)PacketType.StartByte; // start bit = 0xff _dataArray[1] = (byte)PacketType.BnoDump; _delay = delay; _precision = (int)System.Math.Pow(10, sigFigs - 1); _workItem = new WorkItem(OnTaskExecute, ref _dataArray, loggable: true, persistent: true, pauseable: true); _bnoSensor.Begin(); }