val_1=analogRead(B_1); // checks each sensor value and stores it
delay(1); // each value must be checked twice with a
val_1=analogRead(B_1); // delay inbetween to provide consistant values
val_2=analogRead(B_2);
delay(1);
val_2=analogRead(B_2);
There is really no need to read the pin twice. It's the delay that makes the second reading stable. Dump the first one.