Example #1
0
        //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        #region constructor
        //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        public C_Motor(byte _id) // because of search motor
        {
            id       = 0;
            motorLog = e_LogMsgSource.mot;
            reg      = new C_ByteRegister();

            angleWanted = new C_Value();
            //angleWanted.DecDefault = C_Value.angleFull.DecDefault;
            speedWanted = new C_Value();
            C_Value.angleFull.DecDefault = angleWanted.DecDefault;
            C_Value.angleFull.Dec        = angleWanted.Dec;

            angleSeen = new C_Value(C_Value.angleFull);
            speedSeen = new C_Value(C_Value.speedFull);
            angleSent = new C_Value(C_Value.angleFull);
            speedSent = new C_Value(C_Value.speedFull);
        }
Example #2
0
        public C_Motor(e_rot _rot, byte _id, C_Value _angle, C_Value _speed)
        {
            id  = _id;
            reg = new C_ByteRegister();

            angleWanted = _angle;
            speedWanted = _speed;

            C_Value.angleFull.DecDefault = angleWanted.DecDefault;
            C_Value.angleFull.Dec        = angleWanted.Dec;
            angleSeen = new C_Value(C_Value.angleFull);
            speedSeen = new C_Value(C_Value.speedFull);
            angleSent = new C_Value(C_Value.angleFull);
            speedSent = new C_Value(C_Value.speedFull);



            rotMotor = _rot;
            switch (rotMotor)
            {
            case (e_rot.yaw):
                motorLog = e_LogMsgSource.mot_yaw;
                break;

            case (e_rot.pitch):
                motorLog = e_LogMsgSource.mot_pitch;
                break;

            case (e_rot.roll):
                motorLog = e_LogMsgSource.mot_roll;
                break;
            }

            //angleHex = new byte[2] { 0, 0 };
            if (cmdinEx_initialized == false)
            {
                INIT_cmdinEx();
            }
        }