Hmm I'm working on something similar atm
Using this page
http://www.instructables.com/id/Bi-directional-LED-Sensing-Try-out/With a 4 LED setup and this code I am getting some results but not anything I can use reliably yet.
I am finding a noticeable difference in the red LEDs compared to the water clear superbright .
The water clear superbright gives pretty good results with up to a half inch separation between the LEDs
I will try your setup Thanks
My Code at present for testing
const int led1 = A2;
const int led2 = A1;
int value1, value2;
int threshold1 = 120;
int threshold2 = 120;
void setup(){
Serial.begin(9600);
pinMode(led1,INPUT);
pinMode(led2,INPUT);
}
void loop(){
value1 = analogRead(A2);
value2 = analogRead(A1);
if(value1 >= threshold1){
Serial.print("Value 1 : ");
Serial.println(value1);
out(led1,led2,threshold1);
pinMode(led2,INPUT);
}
else if(value2 >= threshold2){
Serial.print("Value 2 : ");
Serial.println(value2);
out(led2,led1,threshold2);
pinMode(led1,INPUT);
}
}
void out(int a, int b, int threshold){
pinMode(b,OUTPUT);
//if (a==led2)
//delay(30);
//else
//delay(60);
int value = analogRead(a);
if(value >= threshold){
analogWrite(b,value);
}
else{analogWrite(b,0); }
Serial.print("Value Following: ");
Serial.println(value2);
}