ROBOTC.net forums
http://www.robotc.net/forums/

Help with the 8 Channel Servo Controller for NXT
http://www.robotc.net/forums/viewtopic.php?f=41&t=8926
Page 1 of 1

Author:  uskjmp14 [ Thu Jun 05, 2014 11:08 pm ]
Post subject:  Help with the 8 Channel Servo Controller for NXT

Hello,

I am trying to change the default neutral position of some of the channels in my servo controller. I created a version using Robot C of the NXC program in the Mindsensors NXC library.

Here is the subroutine code I wrote:

bool NXTServoInitialDefault(tSensors link, char channel, ubyte address) {

memset(NXTSERVO_I2CRequest, 0, sizeof(tByteArray));
NXTSERVO_I2CRequest[0] = 3; // Message size
NXTSERVO_I2CRequest[1] = address; // I2C Address
NXTSERVO_I2CRequest[2] = NXTSERVO_CMD; // Command Register
NXTSERVO_I2CRequest[3] = 'I'; // Command
writeI2C(link, NXTSERVO_I2CRequest);
wait1Msec(100);

memset(NXTSERVO_I2CRequest, 0, sizeof(tByteArray));
NXTSERVO_I2CRequest[0] = 3; // Message size
NXTSERVO_I2CRequest[1] = address; // I2C Address
NXTSERVO_I2CRequest[2] = NXTSERVO_CMD; // Command Register
NXTSERVO_I2CRequest[3] = channel; // Channel
return writeI2C(link, NXTSERVO_I2CRequest);
}

And it is not working. The default neutral position is not changed. Can you tell what can be wrong?

Thanks

Author:  BurningLights [ Fri Jun 06, 2014 8:58 am ]
Post subject:  Re: Help with the 8 Channel Servo Controller for NXT

It looks like you might not be doing the commands quite right. Check out this document: http://www.mindsensors.com/index.php?module=documents&JAS_DocumentManager_op=downloadFile&JAS_File_id=1263. It's the official Mindsensors guide for the NXTServo-v3 sensor. Take a look at pages 4-8, especially page 7 for the I2C command information.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/