#region VEXcode Generated Robot Configuration
from vex import *
import urandom
import math
# Brain should be defined by default
brain=Brain()
# Robot configuration code
controller_1 = Controller(PRIMARY)
L1 = Motor(Ports.PORT1, GearSetting.RATIO_18_1, False)
L2 = Motor(Ports.PORT2, GearSetting.RATIO_18_1, False)
L3 = Motor(Ports.PORT3, GearSetting.RATIO_18_1, False)
R1 = Motor(Ports.PORT4, GearSetting.RATIO_18_1, True)
R2 = Motor(Ports.PORT5, GearSetting.RATIO_18_1, True)
R3 = Motor(Ports.PORT6, GearSetting.RATIO_18_1, True)
# wait for rotation sensor to fully initialize
wait(30, MSEC)
# Make random actually random
def initializeRandomSeed():
wait(100, MSEC)
random = brain.battery.voltage(MV) + brain.battery.current(CurrentUnits.AMP) * 100 + brain.timer.system_high_res()
urandom.seed(int(random))
# Set random seed
initializeRandomSeed()
def play_vexcode_sound(sound_name):
# Helper to make playing sounds from the V5 in VEXcode easier and
# keeps the code cleaner by making it clear what is happening.
print("VEXPlaySound:" + sound_name)
wait(5, MSEC)
# add a small delay to make sure we don't print in the middle of the REPL header
wait(200, MSEC)
# clear the console to make sure we don't have the REPL in the console
print("\033[2J")
#endregion VEXcode Generated Robot Configuration
myVariable = 0
SpeedLeft = 0
SpeedRight = 0
def when_started1():
global myVariable, SpeedLeft, SpeedRight
while True:
L1.spin(FORWARD, controller_1.axis3.position(), PERCENT)
L2.spin(FORWARD, controller_1.axis3.position(), PERCENT)
L3.spin(FORWARD, controller_1.axis3.position(), PERCENT)
R1.spin(FORWARD, controller_1.axis2.position(), PERCENT)
R2.spin(FORWARD, controller_1.axis2.position(), PERCENT)
R3.spin(FORWARD, controller_1.axis2.position(), PERCENT)
wait(5, MSEC)
when_started1()
This is currently my code for my drivetrain is there any way to make it better it should be a tank drive ANYTHING HELPS also I AM VERY NEW TO CODING so please don’t roast me ![]()