VexIQ Basic Programming

I am new to the VexIQ programming so I am trying out some basic drive train motions. Yesterday, I created a basic program and successfully tested it. Today, when I tried to run the same program it went into a spin mode after the first block. I tried erasing the program and downloading it again with no success.

Can you post your code? Is the second block a turn command?

Yes, the second block is a turn right 75 degrees. Not sure how to post code on the forum

Thanks!

// Include the IQ Library
#include “iq_cpp.h”

// Allows for easier use of the VEX Library
using namespace vex;

int Brain_precision = 0;
float myVariable;

int whenStarted1() {
Brain.Screen.print(“08-02-20”);
Drivetrain.driveFor(forward, 144.0, inches, true);
Drivetrain.turnFor(right, 75.0, degrees, true);
Drivetrain.driveFor(forward, 36.0, inches, true);
Drivetrain.turnFor(left, 75.0, degrees, true);
Drivetrain.driveFor(forward, 250.0, inches, true);
Drivetrain.turnFor(left, 75.0, degrees, true);
Drivetrain.driveFor(forward, 150.0, inches, true);
Drivetrain.turnFor(left, 75.0, degrees, true);
Drivetrain.driveFor(forward, 275.0, inches, true);
Drivetrain.turnFor(right, 45.0, degrees, true);
Drivetrain.driveFor(forward, 24.0, inches, true);
Drivetrain.turnFor(left, 45.0, degrees, true);
Drivetrain.driveFor(forward, 48.0, inches, true);
Drivetrain.turnFor(left, 75.0, degrees, true);
Drivetrain.driveFor(forward, 150.0, inches, true);
Drivetrain.turnFor(right, 75.0, degrees, true);
Drivetrain.driveFor(forward, 36.0, inches, true);
Brain.playSound(tada);
return 0;
}
Here is the text commands for the program.

int main() {
// Calibrate the Drivetrain Gyro
calibrateDrivetrain();

whenStarted1();
}

First thing is, do you have a gyro plugged in to the port number that matches your robot configuration in VEXcode?
If you do, press X on the Brain and go to device info. Find the port with your Gyro using the up.or down arrow. When you turn the robot, the the values for the Gyro on the Brain screen change correctly?

1 Like

No the gyro numbers are not correct. I am using port 4 for the gyro and when I turn it 90 degrees it takes several minutes for the turn to register. the rate is reading: 0.3 dps which explains why it it taking several minutes to catch up.

Thanks!