|
Page 1 of 1
|
[ 2 posts ] |
|
Cannot seem to solve this issue. Please help.
| Author |
Message |
|
jbeagan
Rookie
Joined: Fri Oct 26, 2012 2:01 pm Posts: 6
|
 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 |
|
 |
|
JohnWatson
Site Admin
Joined: Thu May 24, 2012 12:15 pm Posts: 399
|
 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 |
|
|
|
Page 1 of 1
|
[ 2 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 4 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
|
|