ROBOTC.net forums
http://www.robotc.net/forums/

Movement Issue
http://www.robotc.net/forums/viewtopic.php?f=63&t=12715
Page 1 of 1

Author:  Undefined [ Fri Dec 04, 2015 5:22 am ]
Post subject:  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;
      }
   }
}

Author:  Tabor473 [ Fri Dec 11, 2015 10:37 pm ]
Post subject:  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)

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/