Main structure containing all sensor data it does contains Motor info, Sensor as well as I2C
Ejemplo n.º 1
0
 /// <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();
         }
     }
 }
Ejemplo n.º 2
0
 /// <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();
         }
 }