Jump to content

Recommended Posts

Posted

Hi all, I have a problem to get Two nxt up in a single project file....

 

What I have done is following the LegoMotorSamle:

http://channel9.msdn.com/wiki/default.aspx/Channel9.LEGOMotorSample

 

And I success to control the 3 motor...

 

By following the step... I create a new manifest file which consist of 6 motor and 2 bricks

 

3 motor connect to the COM40 brick and 3 motor connect to the COM41 brick...

 

Then I extend the partner list like this:

 

***********

************* motor:MotorA40

***********

***********

************* motor:MotorB40

***********

***********

************* motor:MotorC40

*********** ***************

***********

***********

***********

************* motor:MotorA41

***********

***********

************* motor:MotorB41

***********

***********

************* motor:MotorC41

***********

 

 

 

 

In the Project side... I link it up like this :

*[Partner(motor.Contract.Identifier + ":MotorA40",

*********** Contract = legomotor.Contract.Identifier,

*********** Optional = false,

*********** CreationPolicy = PartnerCreationPolicy.UsePartnerListEntry)]

******* private motor.MotorOperations _motorA40 = new motor.MotorOperations();

 

 

******* [Partner(motor.Contract.Identifier + ":MotorB40",

*********** Contract = legomotor.Contract.Identifier,

*********** Optional = false,

*********** CreationPolicy = PartnerCreationPolicy.UsePartnerListEntry)]

******* private motor.MotorOperations _motorB40 = new motor.MotorOperations();

 

 

******* [Partner(motor.Contract.Identifier + ":MotorC40",

*********** Contract = legomotor.Contract.Identifier,

*********** Optional = false,

*********** CreationPolicy = PartnerCreationPolicy.UsePartnerListEntry)]

******* private motor.MotorOperations _motorC40 = new motor.MotorOperations();

 

******* [Partner(motor.Contract.Identifier + ":MotorA41",

********* Contract = legomotor.Contract.Identifier,

********* Optional = false,

********* CreationPolicy = PartnerCreationPolicy.UsePartnerListEntry)]

******* private motor.MotorOperations _motorA41 = new motor.MotorOperations();

 

 

******* [Partner(motor.Contract.Identifier + ":MotorB41",

*********** Contract = legomotor.Contract.Identifier,

*********** Optional = false,

*********** CreationPolicy = PartnerCreationPolicy.UsePartnerListEntry)]

******* private motor.MotorOperations _motorB41 = new motor.MotorOperations();

 

 

******* [Partner(motor.Contract.Identifier + ":MotorC41",

*********** Contract = legomotor.Contract.Identifier,

*********** Optional = false,

*********** CreationPolicy = PartnerCreationPolicy.UsePartnerListEntry)]

******* private motor.MotorOperations _motorC41 = new motor.MotorOperations();

 

It is just similar to the sample...* But the problem is, when I try something like:

*************************** _motorA40.SetMotorPower(new motor.SetMotorPowerRequest(1.0));

*************************** _motorB41.SetMotorPower(new motor.SetMotorPowerRequest(1.0));

 

so that COM40's MotorA and COM41's MotorB should be at power 1...

But the result is only COM40's Motor A and Motor B will rotate...

That is... the _motorB41 still pointing to the COM40's motor.....

 

I have due with this problem quite a few day already.... can someone tell me what wrong is it? Thanks~

 

 

 

 

 

 

More...

 

View All Our Microsoft Related Feeds

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...