1. Welcome Guest! In order to create a new topic or reply to an existing one, you must register first. It is easy and free. Click here to sign up now!.
    Dismiss Notice

Using Two Lego NXT in a single Project

Discussion in 'Microsoft News' started by NewsBot, Apr 22, 2008.

  1. NewsBot

    NewsBot I Got News

    Joined:
    Feb 8, 2006
    Messages:
    1,813
    Operating System:
    Windows Vista Home Premium
    Hi all, I have a problem to get Two nxt up in a single project file....

    What I have done is following the LegoMotorSamle:


    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~








     

Share This Page