View unanswered posts | View active topics It is currently Sun May 26, 2019 12:06 am






Reply to topic  [ 2 posts ] 
No reverse/turn with NXT robots 
Author Message
Rookie

Joined: Tue Sep 09, 2014 12:25 pm
Posts: 4
Post No reverse/turn with NXT robots
Hey there. I have working code in the real world (with real robots) that executes flawlessly. When I go to set this up in the virtual worlds it will not turn or reverse. This is for the NXT REMBOT.

Code:
task main()
{
    nMotorEncoder[motorC] = 0;
    nMotorEncoder[motorB] = 0;

    nMotorEncoderTarget[motorC] = 1440;
    nMotorEncoderTarget[motorB] = 1440;

    motor[motorC] = 50;
    motor[motorB] = 50;
    wait1Msec(3000); //forward

    nMotorEncoder[motorC] = 0;
    nMotorEncoder[motorB] = 0;

    nMotorEncoderTarget[motorC] = 180;
    nMotorEncoderTarget[motorB] = 180;

    motor[motorC] = -50;
    motor[motorB] = 50;
    wait1Msec(600); //turn

    nMotorEncoder[motorC] = 0;
    nMotorEncoder[motorB] = 0;

    nMotorEncoderTarget[motorC] = 1800;
    nMotorEncoderTarget[motorB] = 1800;

    motor[motorC] = 50;
    motor[motorB] = 50;
    wait1Msec(3000); //forward

    nMotorEncoder[motorC] = 0;
    nMotorEncoder[motorB] = 0;

    nMotorEncoderTarget[motorC] = 180;
    nMotorEncoderTarget[motorB] = 180;

    motor[motorC] = 50;
    motor[motorB] = -50;
    wait1Msec(600);

    nMotorEncoder[motorC] = 0;
    nMotorEncoder[motorB] = 0;

    nMotorEncoderTarget[motorC] = 540;
    nMotorEncoderTarget[motorB] = 540;

    motor[motorC] = 50;
    motor[motorB] = 50;
    wait1Msec(2000); //forward

    nMotorEncoder[motorC] = 0;
    nMotorEncoder[motorB] = 0;

    nMotorEncoderTarget[motorC] = 180;
    nMotorEncoderTarget[motorB] = 180;

    motor[motorC] = -50;
    motor[motorB] = 50;
    wait1Msec(600); //turn

    nMotorEncoder[motorC] = 0;
    nMotorEncoder[motorB] = 0;

    nMotorEncoderTarget[motorC] = 360;
    nMotorEncoderTarget[motorB] = 360;

    motor[motorC] = 50;
    motor[motorB] = 50;
    wait1Msec(2000); //forward
}


Tue Sep 23, 2014 5:48 pm
Profile
Rookie

Joined: Tue Sep 09, 2014 12:25 pm
Posts: 4
Post Re: No reverse/turn with NXT robots
this is version 4.26 fyi


Tue Sep 23, 2014 5:58 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


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.