Help with coding

Our code is this, But for some reasons our code won’t work 100% the arm movement and the drive will not work but the claw movement is the only thing that works, How can we fix this?

#pragma config(Motor,  port1,           armR,          tmotorVex393_HBridge, openLoop)
#pragma config(Motor,  port2,           right1,        tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port3,           right2,        tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port4,           right3,        tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port5,           left1,         tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port6,           left2,         tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port7,           left3,         tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port8,           clawR,         tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor,  port9,           clawL,         tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port10,          armL,          tmotorVex393_HBridge, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
		//right side

		//left side

		//arm up and down
		if (vexRT[Btn6U] == 1)
		else if (vexRT[Btn6D] == 1)

	//claw up and down
		if (vexRT[Btn5U] == 1)
		else if (vexRT[Btn5D] == 1)

The code doesn’t work nothing is working.

Maybe try putting the actions in different tasks? Also, I don’t see the point in dividing your joystick values. Shouldn’t be causing your problems, but it might be. If it’s to reverse the polarity of the motors, I usually just switch around the 2 wire connections.

I’m not a coding wizard, but Ibalways use seperate tasks to control each function on the robot. Could also be that you need to do a firmware download and then try again.

Also, change the pragma comment from “‘ROBOTC’ CONFIGURATION WIZARD” to “‘HARRY’ CONFIGURATION WIZARD.”
I think the robot likes it. Or it’s just me.

Could someone confirm that’s it’s okay to have numbers in your motor names? Sonething tells me it’s not, but I’m not sure. Might want to switch your motor names to “rightOne” instead of “Right1” and see if that works.

It’s fine to have numbers in motor names (we do)

Have you confirmed the port numbers are correct? Are you sure the arm motors should be spinning in the same direction instead of opposite like the drivetrain? Are you sure all the motors and motor controllers work? Have you tested each individually? If things are attached together and one motor trying to sit still while the other(s) are trying to move, or if they’re attached and they’re trying to go opposite, fighting each other in such ways could make nothing seems to work even if almost all of it is working.

All things have been tested. And i will see to the opposite value possibility.

you don’t need






will work. (For if() statements as well)

I don’t know but I could give what y 'all need in graphical.

@Got a Screw Loose
The code currently does not work. Nothing of it is working anybody know how to fix it?

So the claw movement stopped working? Are some ports fried?

I had the same thought as @Got a Screw Loose . If you haven’t changed the code and the claw has stopped working, then there is something off elsewhere. Have you tried using an entirely different Cortex?

  1. lift your robot so that the wheels can spin freely. manually spin the wheels, all the wheels should move in one direction without much effort.
  2. unplug right 1-3 and left 2-3 with only left 1 plug in the cortex
  3. test from you joystick to see if the left 1 spins and at what direction. if do not spin, check your motor left 1 and motor controller.
  4. do the same thing (2-3) for the right 1-3 and left 2-3.

I got slightly confused by “rob,” but now I see that it means “robot.”
In my team,” we have a “ROB,” which stands for Random Object Bucket. It’s an emergency cleanup protocol where we all parts laying on the table into a bucket. Usually it’s used when we lose track of time and have to leave very quickly. If we let it go for more than two times, it gets to be a pain to sort back out.

Anyway, what’s being suggested is trying to find the root cause of the problem on the hardware. Just work through the issues until you find what doesn’t work specifically. It’s a common troubleshooting technique.

@Got a Screw Loose fixed thanks

Awesome! Any time!

@Got a Screw Loose
The cortex burned it self out … We changed it to a different cortex and the program will still not work. We think the problem is with the coding because originally the arm worked but now nothing will work.

If nothing is working, but it was, then it’s not in the code. Unless you changed it. Try to unplug a motor and plug in one that you know works. If it doesn’t run, then it’s something weird with the Cortex still. It might also be that your motors got shorted or something. Is there whining at all?

@Got a Screw Loose
No there isn’t any wining and all the motors work have have been tested.

Have the ports been tested with a Simple motor[motorname]=127; code?

@Got a Screw Loose
We figured out the problem our batteries were damaged and sending to much power to the cortex causing them to not work and then setting the cortex on fire. we have already lost two cortexes to this process

Glad you found the problem. Sorry you lost Cortexes in the process. You can see why a bunch of us were questioning your motors, the controllers, and the Cortex.