Robot Mesh confused about down up and L1 L2

I am uploading this code but whenever I press a button up and down it moves 1 motor up and whenever I press the L buttons it moves the other motor… I have never used the L buttons in my code. Here is a copy of the code for the motors.
if con.buttonUp.pressing():
Cube_left_power = 100
Cube_right_power = 100

	if con.buttonDown.pressing():
		Cube_right_power = 100
		Cube_left_power = 100

Any chance you can set the project to public and provide a link so I can see the whole thing? (For code formatting on the forum, you’re going to want to use two sets of ``` around your code, or paste in the code, highlight it, then click the </> button.)

Also, be sure you’re starting the right program and there’s no errors in the console at the bottom, etc.

Here is my code

# VEX V5 Python-Project with Competition Template
import sys
import vex
from vex import *

#region config
brain      = vex.Brain()
Left       = vex.Motor(vex.Ports.PORT1, vex.GearSetting.RATIO18_1, False)
Right      = vex.Motor(vex.Ports.PORT2, vex.GearSetting.RATIO18_1, False)
Cube_left  = vex.Motor(vex.Ports.PORT3, vex.GearSetting.RATIO18_1, False)
Cube_right = vex.Motor(vex.Ports.PORT5, vex.GearSetting.RATIO18_1, False)
#endregion config

# Creates a competition object that allows access to Competition methods.
competition = vex.Competition()

def pre_auton():
    # Example: setting initial positions

def autonomous():
    # Place autonomous code here

def drivercontrol():
    # Place drive control code here, inside the loop
    while True:
        Left_power = 0
        Right_power = 0
        Cube_left_power = 0
        Cube_right_power = 0
        move = con.axis3.position()
        steer = con.axis1.position()
        if move != 0 or steer != 0:
    		Left_power = move + steer
    	if move != 0 or steer != 0:
		    Right_power = move - steer
    	# buttonL1: Reverse
    	if con.buttonUp.pressing():
	    	Cube_left_power = 100
	    	Cube_right_power = 100
    	# buttonL2: Forward
    	if con.buttonDown.pressing():
    		Cube_right_power = 100
    		Cube_left_power = 100
    	Left.spin(vex.DirectionType.FWD, Left_power)
    	Right.spin(vex.DirectionType.FWD, Right_power)
    	Cube_left.spin(vex.DirectionType.FWD, Cube_left_power)
    	Cube_right.spin(vex.DirectionType.FWD, Cube_right_power)
        # This is the main loop for the driver control.
        # Each time through the loop you should update motor
        # movements based on input from the controller.

# Do not adjust the lines below

# Set up (but don't start) callbacks for autonomous and driver control periods.

# Run the pre-autonomous function.

# Robot Mesh Studio runtime continues to run until all threads and
# competition callbacks are finished.

Not set to public. Options gear -> Privacy drop down -> public (including code)

But from the updated paste, your code doesn’t create the controller object con. You manually changed something in the automatic config section and erased con = vex.Controller(vex.ControllerType.PRIMARY). Probably when you added con.set_deadband(5). I can say for certain that whatever code you are running when you tell the robot to run is not the code that you pasted here, as this code should crash with a Name Error on setting the deadband for an undefined object.

1 Like

it should be public now. My code doesn’t do anything once I added the code line you sent me but no errors are coming up.

Your code is successful at running a robot for me. It doesn’t do what you probably wanted it to, but it does tell us your problem is somewhere in the build/download/run process or the hardware, not the code. What steps are you taking to build, download, and run? What clicks, button presses, etc.?

1 Like

I turn on the robot then turn on controller then plug in the cord to my computer click connect then download then unplug the cord when it finishes and the code on the robot is running but it does nothing so i exit out back to home screen the go back to the code then run it and nothing happens.

1 Like

Is the other end in the Brain or the handheld controller? It shouldn’t make a difference if the handheld controller and Brain are paired, but making assumptions is dangerous in troubleshooting.

Don’t click Connect when doing build/download. It doesn’t do what you think it does. The code that’s running after you download is not your program, but rather our Connect program, which gives you control over the robot devices from the right-hand pane in the editor. Just hooking the Brain or handheld controller to the computer will automatically establish a data connection that Robot Mesh Studio can detect. You don’t need to click Connect to make RMS aware of the robot.

Which home screen? Which code? Which run button? Are these actions on the robot or in the browser?

Here’s all you (should) need to do:

  1. Turn the Brain on if it isn’t already.
  2. Connect the Brain or handheld controller to the computer with a USB cable.
    1b. If using the handheld controller for wireless download, make sure it is communicating with the Brain. Look for flashing lights on the radio module. If it isn’t flashing, establish a pairing by connecting the handheld controller to the Brain with a V5 Smart Cable. When the Smart Cable is disconnected, the radio should begin flashing after a short delay.
  3. In the editor that has your code open, press the Run button at the top.

That’s all you should have to do. Using the Run button will end any running program, download your code, then start your program.

1 Like

the cord is connecting the brain to my controller. the home screen is on the robot and I am clicking the power button to go back and the stop button on the screen of the v5 brain and running my code that I showed you and the actions are on the robot. The radio was blinking red before I connected it so is that okay. My robot is running now but only half the motors are working. The left motor in my drive train is working and the cube left is working but none of the other motors are working but I switched the motors and ports and the other motors are working now. It seems like only half the motors in each code are running.

Are you pressing the button on the brain with the icon of a controller titled Drive or the one with a Robot Mesh gear over “.py” titled “1: Tower_Take…”?

the one with the .py

Hmm. Ports on the Brain might be shot. Try swapping the unresponsive ones around to another port in the code and redownloading.

one of our motors were faulty and something is wrong with the download process and it probably lies in either the brain or controller.