/// <summary> /// Initialize the birck, create the structure and setup the serial port /// </summary> /// <param name="myserial">serial port to use</param> /// <param name="autostart">starts automatically the reading thread</param> public Brick(SerialDevice myserial, bool autostart) { if (brickPi == null) { brickPi = new BrickPiStruct(); } if (serialPort == null) { SelectAndInitSerial(myserial).Wait(); } if (autostart) { if (!isThreadRunning) { Start(); Task.Delay(100).Wait(); } } }
/// <summary> /// Initialize the birck, create the structure and setup the serial port /// </summary> /// <param name="myserial">serial port to use</param> /// <param name="autostart">starts automatically the reading thread</param> public Brick(SerialDevice myserial, bool autostart) { if (brickPi == null) brickPi = new BrickPiStruct(); if (serialPort == null) SelectAndInitSerial(myserial).Wait(); if (autostart) if (!isThreadRunning) { Start(); Task.Delay(100).Wait(); } }