User guide

Copyright © 2010, Dr Robot Inc. All Rights Reserved.
www.DrRobot.com
- 21 -
leftWheelMotor.encoderDir = myJaguar.GetEncoderDir4();
rightWheelMotor.encoderPos = myJaguar.GetEncoderPulse5();
rightWheelMotor.encodeSpeed = myJaguar.GetEncoderSpeed5();
rightWheelMotor.encoderDir = myJaguar.GetEncoderDir5();
//temperature sensor here
RightArmMotorTemp =
Trans2Temperature((double)myJaguar.GetCustomAD7());
leftArmMotorTemp =
Trans2Temperature((double)myJaguar.GetCustomAD5());
leftWheelTemp =
Trans2Temperature((double)myJaguar.GetCustomAD6());
rightWheelTemp =
Trans2Temperature((double)myJaguar.GetCustomAD8());
}
NOCONTROL = -32768;
To stop all motor, you could use:
myJaguar.DcMotorPwmNonTimeCtrAll(16384, 16384, 16384, 16384, 16384,
16384);
To control track/arm motor using PWM control with value 32767 (full PWM) you could use:
myJaguar.DcMotorPwmNonTimeCtrAll(32767,NOCONTROL, NOCONTROL, NOCONTROL,
NOCONTROL, NOCONTROL);
or
myJaguar.DcMotorPwmNonTimeCtr(0,32767);
Using position control, move motor to encoder position 2000 in 2000 ms, you could use:
myJaguar.DcMotorPositionTimeCtrAll(2000,NOCONTROl,NOCONTROL,NOCONTROL,N
OCONTROL, NOCONTROL, 2000);
or
myJaguar.DcMotorPositionTimeCtr(0, 2000, 2000);
Using velocity control, move motor at encoder speed 200, you could use:
myJaguar.DcMotorVelocityNonTimeCtrAll(200,NOCONTROL,NOCONTROL,NOCONTROL
,NOCONTROL,NOCONTROL);
or
myJaguar.DcMotorVelocityNonTimeCtr(0,200);
Same for the track/wheel motor control, the left track/wheel motor is at PWM channel 3, right track/wheel motor
is at PWM channel 4.
To control head lights, using expanded IO port bit7.
Turn off light:
myJaguar.SetCustomDOUT(expandedIO & 0x7f);
Turn on light: myJaguar.SetCustomDOUT(expandedIO | 0x80);
Software watchdog: The system will auto stop all the motors if it does not received any data package in 5 second.