Stealth0113:
@ryschwith: i don't fully understand your code. The "for" loop is clear to me, but the "if" string looks like gibberish to me...Can you explain to me why furthest < 2 stands for 45 or 90 degrees??
And why did you use the light45 = false and light135 = false? I don't see it back anywhere in the code
For loop iterates through an array of the 3 sensors
i is the sensor number- 0, 1, 2
It stores the highest reading, it's sensor number and value
if furthest < 2 means if furthest is 0 or 1
if furthest > 0 means if furthest is 1 or 2
0 is 45
1 is 90
2 is 135
if 45 or 90 are furthest, light the respective LED.
if 90 or 135 are furthest, light LED
one led is 45 degs, second led is 135 degrees, if neither lit, it's 90.