Program not running on Vex Cortex 2.0 after uploading

#1

I am new to Vex and new to RobotC and I’ve created this program:

#pragma config(Sensor, dgtl1, touch, sensorTouch)
#pragma config(Sensor, dgtl3, sonar, sensorSONAR_cm)
#pragma config(Sensor, dgtl9, encoderLeft, sensorQuadEncoder)
#pragma config(Sensor, dgtl11, encoderRight, sensorQuadEncoder)
#pragma config(Motor, port1, right, tmotorVex393_HBridge, openLoop)
#pragma config(Motor, port8, claw, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port9, arm, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port10, left, tmotorVex393_HBridge, openLoop, reversed)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//

//Functions for driver control

void driveControl() {
motor[left] = vexRT[Ch3]; //left motor to ch 3
motor[right] = vexRT[Ch2]; //right motor to ch 2
}
void armControl() {
if (vexRT[Btn5U] == 1) {
motor [arm] = 100;
}
if (vexRT[Btn5D] ==1) {
motor[arm] = -100;
}
if (vexRT[Btn5U] == 0 && vexRT[Btn5D] == 0) {
motor[arm] = 0;
}
}

void clawControl () {
if (vexRT [Btn6U] ==1) {
motor[claw] = 100;
}
if (vexRT[Btn6D] ==1) {
motor[claw] = -100;
}
if (vexRT[Btn6U] == 0 && vexRT[Btn6D] == 0) {
motor[claw] = 0;
}

}

task main()
{
while(true) {
driveControl();
armControl();
clawControl();
}

}

Trying to get the original Clawbot to work again. I’ve programmed it the way I believe is correct but when I plug in all the wires after building the Clawbot, it doesn’t work. Nothing happens. I’ve tried updating the firmware for all the cortexes, the vexnet keys, the remotes - nothing happens. What am I doing wrong?

Thank you!

0 Likes

#2

If you click firmware download it should reinstall the base program don’t quote me on that though.

0 Likes

#3

you need while(true) loops and to start threads instead of just calling the functions.

0 Likes