View unanswered posts | View active topics It is currently Wed Sep 03, 2014 3:54 am






Reply to topic  [ 3 posts ] 
NXT motors will not run with v. 3.04 
Author Message
Rookie

Joined: Tue Aug 14, 2007 1:38 pm
Posts: 16
Post NXT motors will not run with v. 3.04
I have loaded v 3.04 on my class set of NXT's. On several bots when we want to run a motor, they will not run. The program compiles and downloads and all sensors work fine. On the debug window the motor speed is 50 and the PID is at 100 ( as it should be if the motor doesn't run). I can physically turn a motor and the encoders count. This is the first time I've run across this problem, but I was using earlier versions. Any help would be greatly appreciated as our eighth grade is going to do a unit on robotics and programming in a week or so.

Program:

task main()
{ nmotorPIDspeedctrl[motorA]=mtrspeedreg;
while(1==1)
{motor[motorA]=50;}
}


Wed Mar 21, 2012 1:00 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3211
Location: Rotterdam, The Netherlands
Post Re: NXT motors will not run with v. 3.04
Hey there,

It is better to use the Motors and Sensors Setup UI to configure your motors than what you're doing now. You can find this under the "robot" menu.

Also, there is no point in constantly setting the motor speed, set it once, and then just let it do its thing if you're not going to make any changes. The code below should work more like what you'd expect.

Regards,
Xander

Code:
#pragma config(Motor,  motorA,          MOTORA,        tmotorNormal, PIDControl, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main ()
{
  motor[MOTORA] = 50;
  while (true)
  {
    wait1Msec(1);
  }
}

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Wed Mar 21, 2012 1:07 pm
Profile WWW
Rookie

Joined: Tue Aug 14, 2007 1:38 pm
Posts: 16
Post Re: NXT motors will not run with v. 3.04
Thanks for the quick reply. With the same program it all of a sudden started working. Go figure. That has happened numerous times. We just installed Windows 7 and I don't know if that had anything at all to do with it. Anyway, thanks.


Wed Mar 21, 2012 2:36 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 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.