View unanswered posts | View active topics It is currently Mon Sep 01, 2014 8:37 pm






Reply to topic  [ 2 posts ] 
Cannot seem to solve this issue. Please help. 
Author Message
Rookie

Joined: Fri Oct 26, 2012 2:01 pm
Posts: 6
Post Cannot seem to solve this issue. Please help.
Grade 8 STEM teacher. Robot C with Mindstorms - main focus of class.

A student typed this code:

task main()
{

motor[motorC] =100;
motor[motorB] =100;
wait1Msec(4000);

motor[motorC] = 100;
motor[motorB] = 0;
wait1Msec(850);

}

Robot only move straight with no turn(which is what they want). If I remove the turning code(2nd set of three lines) the robot behaves as it should (go straight for 4 seconds). Once I put the code back in line it runs for approximately 6 seconds. No idea what the issue is. Please help.

Thank you very much.

Josh


Thu Jan 17, 2013 9:57 am
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 566
Post Re: Cannot seem to solve this issue. Please help.
What happens when you replace the 850 millisecond wait with a longer period of time (say, 2000 milliseconds)? Does the robot turn correctly then? The only thing I can think of is that the wait command is not long enough for motor C to 'push through' the additional friction of motor B being stopped. On that note, I tried the code you have posted on an NXT bot with a fresh battery (REMBot) and it worked correctly; double check the battery level of the NXT to see if it is low, and if so, I would suggest charging it fully and re-testing the code.

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Fri Jan 18, 2013 5:26 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.