Sending output to arduino

Hello,
We want to position a servo controlled by an arduino at 40 degrees or 140 degrees depending on whether an input from the vex cortex is received or not by the arduino. We do not understand why this program does not work.

Arduino program:

#include <Servo.h>
Servo myServo;

int servito=6;
int cortex=7;

void setup() {

Serial.begin(9600);
myServo.attach(servito);
pinMode(cortex,INPUT);

}

void loop() {

if(digitalRead(cortex)==HIGH) {
myServo.write(140);
delay(1000);
}

else {
myServo.write(40);
delay(1000);}
}

RobotC program:

#pragma config(Sensor, dgtl1, output, sensorDigitalOut)

task main()
{
while(true)
{
SensorValue[dgtl1]=0;
}
}