My brain is freezing when I download my project from vscode, it takes a long time to download. Then I have to take the battery out and put it back in for it to work. Then, the program is downloaded, but when I try to run it it freezes again. Other projects from vexCode IQ is working, so any help on this would be appreciated !
C++, Python ?
Use the feedback tool with the project open and tech support can have a look (assuming you are using the VEX extension)
C++ is what I’m using
Also, when I try to contact the support, it says an error occured
zip up the project folder and post here then
Autonomous-Project-32630B.zip (77.2 KB)
Is there anything wrong ?
It’s Saturday evening, I’m about to eat dinner, I’ll run it on a Brain tomorrow.
All I can say is the code doesn’t actually do anything.
int main() {
// Initializing Robot Configuration. DO NOT REMOVE!
vexcodeInit();
Brain.Screen.print("Hello, VEX!");
}
I know, I did that on purpose, to see what is happening
P.S. - Does the code look correct ? I’ve been trying to do PID for a whole month with many struggles !
Your issue is with this code.
vex::brain Brain;
vex::motor LDMotor = vex::motor(vex::PORT9, 2.5, false);
vex::motor RDMotor = vex::motor(vex::PORT3, 2.5, true);
vex::smartdrive Drivetrain = vex::smartdrive(LDMotor, RDMotor, BrainInertial, 200);;
vex::motor BackRoller = vex::motor(vex::PORT1, true);
vex::motor IntakeRollerA = vex::motor(vex::PORT6, true);
vex::motor IntakeRollerB = vex::motor(vex::PORT4, false);
vex::motor_group IntakeRollers = vex::motor_group(IntakeRollerA, IntakeRollerB);
vex::motor Launcher = vex::motor(vex::PORT7, true);
vex::inertial BrainInertial = vex::inertial();
The smartdrive
vex::smartdrive Drivetrain = vex::smartdrive(LDMotor, RDMotor, BrainInertial, 200);;
is using the BrainInertial instance before it has been created.
update that code to
vex::brain Brain;
vex::inertial BrainInertial = vex::inertial();
vex::motor LDMotor = vex::motor(vex::PORT9, 2.5, false);
vex::motor RDMotor = vex::motor(vex::PORT3, 2.5, true);
vex::smartdrive Drivetrain = vex::smartdrive(LDMotor, RDMotor, BrainInertial, 200);;
vex::motor BackRoller = vex::motor(vex::PORT1, true);
vex::motor IntakeRollerA = vex::motor(vex::PORT6, true);
vex::motor IntakeRollerB = vex::motor(vex::PORT4, false);
vex::motor_group IntakeRollers = vex::motor_group(IntakeRollerA, IntakeRollerB);
vex::motor Launcher = vex::motor(vex::PORT7, true);
Thank you so much ! I’ll make sure to try it !