Beispiel #1
0
        /* CONSTRUCTOR */
        public MultiWiiCore(String portName)
        {
            rcChannels = new RCChannels(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
            rawIMU     = new RawIMU(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
            motor      = new Motor(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
            attitude   = new Attitude(0.0, 0.0, 0.0, 0.0, 0.0);
            message    = new Message(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);

            elapsed = 0.0;
            print   = true;

            serialPort              = new SerialPort();
            serialPort.PortName     = portName;
            serialPort.BaudRate     = 57600;
            serialPort.DataBits     = 8;
            serialPort.Parity       = Parity.None;
            serialPort.StopBits     = StopBits.One;
            serialPort.ReadTimeout  = 0;
            serialPort.WriteTimeout = 2;
            serialPort.Handshake    = Handshake.None;
            serialPort.RtsEnable    = false;
            serialPort.DtrEnable    = false;

            AuxFunctions.openPort(serialPort, print);
        }