Manual
Copyright © Dr Robot Inc. 2008
17
ival = GetMotorCurrent4 (); // Current sensor #4
ival = GetMotorCurrent5 (); // Current sensor #5
ival = GetMotorCurrent6 (); // Current sensor #6
ival = GetMotorCurrent (short channel); // Current sensor #1,2,3,4,5,or 6
Parameter: void // for GetMotorCurrentX
short channel; // 0,1,2,3,4,5 for current sensor #1,2,3,4,5,or 6
Return value: short ival;
Return data interpretation:
The return data is the raw value of the analog to digital converter indicating the motor
current. The data range is between 0 and 4095. The real current can be calculated with the
following formula:
Motor Current (A) = (ival * 3 *375 / 200 /4095) = ival / 728
III.1.10. Encoder
58 short GetEncoderDir1();
59 short GetEncoderDir2();
60 short GetEncoderPulse1();
61 short GetEncoderPulse2();
62 short GetEncoderSpeed1();
63 short GetEncoderSpeed2();
Description:
GetEncoderDirX returns +1, 0 or -1 to indicate the direction of rotation.
GetEncoderPulseX returns the current pulse counter to indicate the position of rotation.
GetEncoderSpeedX returns the current speed of rotation.
Syntax: ival = GetEncoderDir1(); // direction of channel #1
ival = GetEncoderDir2(); // direction of channel #2
ival = GetEncoderPulse1(); // pulse counter of channel #1
ival = GetEncoderPulse2(); // pulse counter of channel #2
ival = GetEncoderSpeed1(); // speed of channel #1
ival = GetEncoderSpeed2(); // speed of channel #2
Parameter: void
Return value: short ival;
Return data interpretation:
(1) GetEncoderDirX returns -1, 0 or 1. 1 stands for positive direction, -1 stands for negative
direction, and 0 stands for no movement.
(2) GetEncoderPulseX returns pulse counter. It is an integral value to rotation with range
of 0 ~ 32767 in cycles.










