View unanswered posts | View active topics It is currently Wed Nov 25, 2015 9:08 pm

Reply to topic  [ 3 posts ] 
DC motors won't move! Need help!!! 
Author Message

Joined: Fri Apr 10, 2009 6:55 pm
Posts: 1
Post DC motors won't move! Need help!!!
We need to get the dc motor for our arm moving, but we're getting a bytecode exception error that says "motor out of range(2)."

We have two DC motor controllers and one servo controller.

The first DC motor controller is on S1 and the second is on S2.

Please help... we need to find a solution in the next 48 hours.

Below is our code:

#pragma config(Hubs, S1, HTMotor, none, none, none)
#pragma config(Hubs, S2, HTMotor, HTServo, none, none)
#pragma config(Motor, mtr_S1_C1_1, motorD, tmotorNormal, openLoop)
#pragma config(Motor, mtr_S1_C1_2, motorE, tmotorNormal, openLoop)
#pragma config(Motor, mtr_S2_C1_1, motorF, tmotorNormal, openLoop)

//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

task main()
motor[mtr_S2_C1_1] = 100;
motor[mtr_S2_C1_1] = 0;

Fri Apr 10, 2009 7:06 pm
User avatar

Joined: Tue Oct 14, 2008 7:16 pm
Posts: 171
Location: Investigating an unidentified ship sighted in Sector 31428
Post Re: DC motors won't move! Need help!!!
To begin with, you should name your motors something other than "motorD"; give them a meaningful name indicitive of their use. Second, and this may be your problem, when you turn a motor on don't use the internal name of mtr_S1_C1_1 use the name you gave it.

Hope this helps.

Captain, Head programmer, School of the Arts, Silverbots Robtics Team #2890
using namespace System;
using namespace Genius;
using namespace Personality;
public ref class Nerd : Geek, IAnserable
    Geek::Type brainMode = Geek::Type::Programmer;

Sat Apr 11, 2009 2:32 pm

Joined: Mon Oct 13, 2008 6:29 pm
Posts: 75
Location: Florida, USA
Post Re: DC motors won't move! Need help!!!
also, any reason to use two sensor ports for your motor controllers? try using one (if you already haven't)

PHUHS Robotics
Team 516 FTW

Daytona Robofest Winning Alliance Captain
Daytona Robofest Inspire Award

Sun Apr 12, 2009 5:08 pm
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.