View unanswered posts | View active topics It is currently Fri Oct 24, 2014 3:02 am






Reply to topic  [ 2 posts ] 
Help with the 8 Channel Servo Controller for NXT 
Author Message
Rookie
User avatar

Joined: Mon Aug 27, 2007 11:44 pm
Posts: 6
Post 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


Thu Jun 05, 2014 11:08 pm
Profile
Expert
User avatar

Joined: Sat Aug 31, 2013 9:15 am
Posts: 138
Post 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.

_________________
FTC Team 6100 Chariots of Fire - Programmer (2012-2013)
FTC Team 7468 Blue Chariots of Fire - Programmer (2013-2014)
FTC Team 7468 Blue Chariots of Fire - Mentor (2014-2015)
Check out our team website at http://cof7468.weebly.com/.


Fri Jun 06, 2014 8:58 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.