I’ve been having trouble printing IME or quadrature sensor data to the brain screen. I’m trying to use .position(degrees) to find the rotation of the encoders after it was last reset, but the printed value once changed from zero is a huge integer as if every change to the encoder prints the result of an int random number generator (positive and negative). It’s in no way related to the actual number of degrees rotated.
Initially I just ignored the problem because I could tell the sensors were functioning properly through autonomous tests, but now I’m working with my lift motor encoder and I’m having trouble debugging it without the data.
// ---- START VEXCODE CONFIGURED DEVICES ----
// Robot Configuration:
// [Name] [Type] [Port(s)]
// Controller1 controller
// LiftMotor motor 5
// ArmMotor motor 6
// IntakeMotor motor 7
// StackerMotor motor 8
// LeftQuad encoder A, B
// RightQuad encoder C, D
// BarPot pot H
// StackBumper bumper G
// Controller2 controller
// LeftBackMotor motor 1
// RightBackMotor motor 2
// LeftFrontMotor motor 3
// RightFrontMotor motor 4
// ---- END VEXCODE CONFIGURED DEVICES ----
#include "vex.h"
using namespace vex;
while(1) {
Brain.Screen.clearScreen();
Brain.Screen.printAt(1, 20, "in loop, we are at %d",LiftMotor.position(turns));
}