Encoder Not Showing In Debug Window

Hello,

I have 4 shaft encoders on my robot. I have all 4 assigned to ports in Motor and Sensor Setup. I am only able to see 3 of them in the debug window. I’ve already swapped in a new Cortex and tried a different encoder, but it still does not show in the Debug window. Does anyone know why this is?

Thanks!

Can you post some simple code to demonstrate this and I will check.
(I moved the thread so you can reply).

It’s not letting me reply.

#pragma config(Sensor, dgtl1, flEncoder, sensorQuadEncoder)
#pragma config(Sensor, dgtl3, frEncoder, sensorQuadEncoder)
#pragma config(Sensor, dgtl5, brEncoder, sensorQuadEncoder)
#pragma config(Sensor, dgtl7, blEncoder, sensorQuadEncoder)
#pragma config(Sensor, dgtl9, liftEncoder, sensorQuadEncoder)
#pragma config(Motor, port2, YMotor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port3, Y2Motor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port4, Y3Motor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port5, clawMotor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, flMotor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port7, blMotor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port8, frMotor, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port9, brMotor, tmotorVex393_MC29, openLoop, reversed)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//

#pragma platform(VEX)

//Competition Control and Duration Settings
#pragma competitionControl(Competition)
#pragma autonomousDuration(20)
#pragma userControlDuration(120)

//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//

#include “Vex_Competition_Includes.c” //Main competition background code…do not modify!

/////////////////////////////////////////////////////////////////////////////////////////
//
// Pre-Autonomous Functions
//
// You may want to perform some actions before the competition starts. Do them in the
// following function.
//
/////////////////////////////////////////////////////////////////////////////////////////

void pre_auton()
{
// Set bStopTasksBetweenModes to false if you want to keep user created tasks running between
// Autonomous and Tele-Op modes. You will need to manage all user created tasks if set to false.
bStopTasksBetweenModes = true;

// All activities that occur before the competition starts
// Example: clearing encoders, setting servo positions, ...

}

/////////////////////////////////////////////////////////////////////////////////////////
//
// Autonomous Task
//
// This task is used to control your robot during the autonomous phase of a VEX Competition.
// You must modify the code to add your own robot specific commands here.
//
/////////////////////////////////////////////////////////////////////////////////////////

task autonomous()
{
// Move forward 300 degrees*//
SensorValue[flEncoder] = 0;
SensorValue[frEncoder] = 0;
SensorValue[blEncoder] = 0;
SensorValue[brEncoder] = 0;

while(SensorValue[flEncoder] < 300)

{
if(SensorValue[flEncoder] > SensorValue[frEncoder])
{
motor[frMotor] = 127;
motor[flMotor] = 100;
}
if(SensorValue[frEncoder] > SensorValue[flEncoder])
{
motor[frMotor] = 100;
motor[flMotor] = 127;
}
if(SensorValue[flEncoder] == SensorValue[frEncoder])
{
motor[brMotor] = 127;
motor[blMotor] = 127;
}

if(SensorValue[blEncoder] > SensorValue[brEncoder])
{
	motor[brMotor] = 127;
	motor[blMotor] = 100;
}
if(SensorValue[brEncoder] > SensorValue[blEncoder])
{
	motor[brMotor] = 100;
	motor[blMotor] = 127;
}
if(SensorValue[blEncoder] == SensorValue[brEncoder])
{
	motor[brMotor] = 127;
	motor[blMotor] = 127;

}
}
motor[frMotor] = 0;
motor[flMotor] = 0;
motor[brMotor] = 0;
motor[blMotor] = 0;

@jpearman Just to add to this I have seen, multiple times, the analog port 1 in the debug window will not display at all (even when we have it programmed). The first thing to show in the list is port 2. If we restart robotC it will usually correct itself and display. Not the end of the world, but it seems similar to the OP’s issue so thought I’d mention it.

I’ve tried to restart Robot C several times, but it still doesn’t display.

Hmm, it displays here ok. Can you post a screen shot?

Isn’t the issue with OP that he uses both ports 4 and 10 for encoders?

Well, that’s true, I didn’t even notice that as the OP said only 3 of 4 were showing. So the encoder in port 4 will not work, but I think they still all show in the debug window, I will have to check again.

Good catch, I believe you may be correct. To the OP, if you don’t know what tabor is referring to: There is an internal cortex wiring “problem” of sorts that means you do not want to use quad encoders on both ports 4 and 10 at the same time. Something to do with how the cortex deals with interrupts I believe. If you change your wiring around so that either port 4 or 10 is not being used it may work.