Thank you for the feedback. Unfortunately it did not work. The ultra sonic sensor is still not kicking on to stop him, and when he is on the floor spinning you physically have to make him stop. what is also happening is the blue LED on the IR keeps flashing while he is spinning so no signal will come through from the remote.
My son wants to use this in his science fair soon, so we are grateful for any help to figure out the issue so he will be able to turn and be able to stop turning without force or cutting power. Also if you know what the problem with the ultrasonic sensor programming is. I have tried everything to set this thing up on a maze follower once a IR button is hit with no luck.
The code I have tried for the US sensor without IR operation is
but it just keeps going with no intention on stopping or turning.