View unanswered posts | View active topics It is currently Tue Sep 27, 2016 3:06 pm






Reply to topic  [ 2 posts ] 
Movement Issue 
Author Message
Rookie

Joined: Fri Dec 04, 2015 5:10 am
Posts: 1
Post Movement Issue
Okay so I'm relatively new to RobotC and I made this code for our VEX robot and when we tested it the wheels started moving before we even turned the controller on and it wouldn't stop. Someone please examine my code and assist me in finding the issue.

Code:
#pragma config(Motor,  port3,           rightWheels,   tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port4,           leftWheels,    tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor,  port5,           claw,          tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port6,           crane,         tmotorVex393_MC29, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main(){
   while(1 == 1){
      motor[leftWheels] = vexRT[Ch3];
      motor[rightWheels] = vexRT[Ch2];

      if(vexRT[Btn5D] && vexRT[Btn5U]){
         motor[crane] = 0;
      } else if(vexRT[Btn5D]){
         motor[crane] = 127;
      } else if(vexRT[Btn5U]){
         motor[crane] = -127;
      } else {
         motor[crane] = 0;
      }

      if(vexRT[Btn6D] && vexRT[Btn6U]){
         motor[claw] = 0;
      } else if(vexRT[Btn6D]){
         motor[claw] = 127;
      } else if(vexRT[Btn6U]){
         motor[claw] = -127;
      } else {
         motor[claw] = 0;
      }
   }
}


Fri Dec 04, 2015 5:22 am
Profile
Moderator
Moderator

Joined: Tue May 19, 2015 3:07 pm
Posts: 91
Post Re: Movement Issue
Were the lights green on the cortex? If they were not green and the motors were turning upload a picture of the wiring going into the cortex as I believe you forgot to use Motor Controller 29s and are just plugging the motor directly into power and ground. (Standard 3 wire cable is signal,power,ground and ROBOTC's control of the motor only adjusts the signal wire so not using that means you are not actually controlling the motor)


Fri Dec 11, 2015 10:37 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


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.