One of our vexnet keys’ light no longer blinks; we are unable to connect the remote to our robot. We have updated firmware on robot, joystick, and programming software. Checked batteries, motors, program, but everything seems to be working except for the wireless connection. Could out key (with blue static light) be a faulty one? It’s brand new!
On your official answer thread, Eli Osornio asked you to try it with the USB A-A tether. At first you said it worked, and then you said it didn’t. Am I reading this correctly?
Correct! At this point, when the robot is tethered, the arm and claw motors work, but the wheels’ motors don’t. I still think that we have a faulty vexnet key (blue light static). Any suggestions?
Can you post your code?
The USB A-A should have no issues, assuming the Cortex and Joystick firmwares are up to date.
The cortex makes a loud noise.
Here is the code:
#pragma config(Motor, port1, leftMotor, tmotorVex393, openLoop)
#pragma config(Motor, port6, clawMotor, tmotorVex393, openLoop)
#pragma config(Motor, port7, armMotor, tmotorVex393, openLoop)
#pragma config(Motor, port10, rightMotor, tmotorVex393, openLoop, reversed)
task main()
{
wait1Msec(2000); // Robot waits for 2000 milliseconds before executing program
// Move forward at full power for 3 seconds
motor[leftMotor] = 127; // Motor on port1 is run at full (127) power forward
motor[rightMotor] = 127; // Motor on port10 is run at full (127) power forward
wait1Msec(3000); // Robot runs previous code for 3000 milliseconds before moving on
while(1 == 1)
{
motor[leftMotor] = vexRT[Ch3]; // Left Joystick Y value
motor[rightMotor] = vexRT[Ch2]; // Right Joystick Y value
while(1 == 1)
{
//Driving Motor Control - joystick remote control
motor[leftMotor] = vexRT[Ch3];
motor[rightMotor] = vexRT[Ch2];
//Arm Control
if(vexRT[Btn6U] == 1)
{
motor[armMotor] = 40;
}
else if(vexRT[Btn6D] == 1)
{
motor[armMotor] = -40;
}
else
{
motor[armMotor] = 0;
}
//Claw Control
if(vexRT[Btn5U] == 1)
{
motor[clawMotor] = 40;
}
else if(vexRT[Btn5D] == 1)
{
motor[clawMotor] = -40;
}
else
{
motor[armMotor] = 0;
}
}
}
}
The cortex makes a loud noise?? Can you elaborate?
The cortex makes this loud “eee” noise as it’s using too much power or something. When we compile the code (keep the USB cable connected to the robot), it makes this loud noise until we click “stop.”
At this point, we are only able to use the remote control when tethered. Otherwise, there is no vexnet connection. We’ll probably have to order a new vextnet UBS key since one of ours has not blinking light and doesn’t’ establish a wireless connection with the microcontroller. The lound “eee” noise breaks off every few seconds. Our robot/parts are brand new.
That’s not the cortex. You need to set Analog deadbands on your joysticks. Those are your motors keening.
Just set them to be +/- 5 and that problem will go away.
Ephermeral_Being is correct, it’s your motors receiving power (not the cortex itself).
This.
At this point, I would say get new keys. If you’ve dropped or banged them up recently, that’s probably why. The vexNet keys are very fragile.
After adding the dead band, I get this error: “Error:Undefined variable ‘nDeadBandSize’. ‘short’ assumed.”
Where can I find more info on how to set analog dead bands to my program?
There is no built in variable “nDeadBandSize” so that must be one of yours.
The general idea is as follows.
if( abs(vexRT Ch1 ]) > 10 )
motor port1 ] = vexRT Ch1 ];
else
motor port1 ] = 0;
When the analog joystick value is the range -10 to +10 the motor is forced to the value of 0.