Okay I came back around to messing with the robot. I took some time off to write the chapters of the thesis thinking I would come back and look at the problem with a fresh mind but I guess I was wrong.
Still I can find no logical explanation as to why the hell I can not read from the sensor but at the same time I can write to it. Adn the problem is that I do have some kind of deadline and being stagnant like this really does not help me. Maybe I should scrap the optical sensor altogether. I am not sure. Anyone managed to interface such a sensor with the SRV?
To make matters worse out of the blue my source code does not compile. I get the error:
make: ldr.exe : command not found. Error 127
At this point of the compile : ldr.exe -f -T BF537 -c srv1-c.ldr srv1-c.bin , creating the loader.
It worked at the end when I wrote that last line of code by hand into the console. Super strange ...
I changed nothing in the makefile nor in the directory. Suffice to say that ldr.exe is already in there. I did not remove it ofcourse. Everything has to go wrong, doesn't it?