Hello my name is Payton and I am having trouble trying to connect my controller to the cortex. I have downloaded the firmware to both the cortex and controller, hit the config button on the cortex, changed the cortex, keys, and the remote, and also established a vex link on everything, but when I try to connect the controller and the cortex with keys it would not connect. There would be a green light on the joystick icon and also on the controller a yellow light would flash rapidly on VEXnet on the cortex two yellow lights would flash rapidly on VEXnet and Game and a green light would flash slowly on robot.
#pragma config(Motor, port2, LFDriveM, tmotorVex393, openLoop)
#pragma config(Motor, port3, LRDriveM, tmotorVex393, openLoop)
#pragma config(Motor, port8, RRDriveM, tmotorVex393, openLoop, reversed)
#pragma config(Motor, port9, RFDriveM, tmotorVex393, 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)
#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()
{
// .....................................................................................
// Insert user code here.
// .....................................................................................
AutonomousCodePlaceholderForTesting(); // Remove this function call once you have "real" code.
}
/////////////////////////////////////////////////////////////////////////////////////////
//
// User Control Task
//
// This task is used to control your robot during the user control phase of a VEX Competition.
// You must modify the code to add your own robot specific commands here.
//
/////////////////////////////////////////////////////////////////////////////////////////
task usercontrol()
{
// User control code here, inside the loop
while (true)
{
motor[LFDriveM] = vexRT[Ch3];
motor[LRDriveM] = vexRT[Ch3];
motor[RFDriveM] = vexRT[Ch2];
motor[RRDriveM] = vexRT[Ch2];
}
}
Here is my code, I do not see anything obviously wrong with it but if any one could help that would be great.
Thank you,
Payton