There's a lot of problems.
1)
Code:
/*DigitalInput(UINT32 slot, UINT32 channel);*/
DigitalInput photoSensor1(8,3);
DigitalInput photoSensor2(8,4);
DigitalInput photoSensor3(8,5);
You can't have those sensors in that slot. Your digital sidecars have to be in slots 4 and 6, not 8.
2)
Code:
/*getting digital input*/
photoSensor1.Get(); //get for sensor 1
photoSensor2.Get(); // get for sensor 2
photoSensor3.Get(); //get for sensor 3
This doesn't do anything useful. You need to assign the result of those function calls to a variable, otherwise the data is lost. Something like:
Code:
bool left, middle, right;
left = photoSensor1.Get(); //get for sensor 1
middle = photoSensor2.Get(); // get for sensor 2
right = photoSensor3.Get(); //get for sensor 3
Then in your if/if else lines you'd use left, middle, and right instead of photoSensorX, e.g.
Code:
if((!left) && (!middle) && (right)){
3)
Code:
myRobot->Drive(0.1, 30.0);
You're using this same command for every case; why? Don't you want it to do different things depending on which sensors are active? Also, 0.1 is probably too slow. I'd say you should be doing at least 0.7 for your speed.
EDIT: There might be more, but that's what jumped out at me.