Hey there, We have a working code with the robot C and limit switch. We download it and we have communication mode: usb or vex net. We have tried USB only and USB/VexNet and some robots are not running without the USB cord. Is there something else we need to click on the robot drop down?
We are using Natural language, Vex not IQ, and PLTW. We do not have VEX IQ marked.
The advice about our code has really helped out and thank you so much.
USB only means that you cant use the Joystick, the code will start running as soon as you turn the Cortex on. USB or VEXnet means itâll try to connect to VEXnet Joystick first and if there is no connection after a certain amount of time (maybe ten seconds) itâll then time out and run the code without VEXnet.
Its been a while since I have used Robot C, but have you established the connection between your two vexnet recievers? If you are using robot C, I am guessing you might be on the EDR platform.
if(SensorValue(Switch)==1)
{
motor[port2] = 127; // if pressed runs the motor
motor[port9] = 127; // if pressed runs the motor
wait1Msec(4000); // robot moves forward for 1 seconds before program ends
motor[port2] = 0; //Stop
motor[port9] = 0; //Stop
}
}
It has worked on several robots. It may be our cortex?
FWIW I got excited for a minute - saw V4 of Robot-C (old PC was V3) - I installed it on a different PC and got the same error: **Severe*:Can't assign to read only 'const' variable
Very obsolete.
edit: actually thatâs a read only variable that indicates the auton mode, I was thinking of something else.
Did you update RobotC firmware on the cortex ? Definitely do no use V3, not sure if that was even compatible with later version of the cortex master firmware.
Selecting âUSB onlyâ was the right thing to do, but make sure you power cycle the cortex after changing modes.