I would do something like this on arduino side, you could also have multiple pwm values for diffrent lights if you wanted it to.
Code:
float PWMsignal;//the signal from the roborio
void setup() {
// put your setup code here, to run once:
PWMsignal=0;//intilizes signal
Serial.begin(9600);//syncs up serial output
}
void loop() {
// put your main code here, to run repeatedly:
PWMsignal=analogRead(3);//reads the pwm value for pin 3
if(PWMsignal=42){//if its whatever pwm value you want turn pin 4 on
digitalWrite(4,HIGH);
}
else{
digitalWrite(4,LOW);
}
Serial.println(PWMsignal);//outputs value to serial port
}