In my book, A Gentle Introduction to Robotics (link), I captured the value of the line follower reporter block into a variable and tested against the four possible values to determine what to do.
Try saving the values of each of the reads into variables and testing the values of those variables. Since you are essentially calling the same function the previous value is been overwritten because it is not saved anywhere.
For what it’s worth, if you choose to just assign the value of the line follower [port] block to a variable, the values for the sensor are:
Value |
Meaning |
0 |
Both sensors over black line |
1 |
Left sensor is over black line, right sensor is not |
2 |
Right sensor is over black line, left sensor is not |
3 |
Neither sensor is over the line |