Motors stopping when turining


#1

My program was working well and then stopped switching directions when a new was pressed. This only happens when the robot is turning either left or right. If I touch it it stops then has to be turned off then on again to work but will have the same issue if I tell it to turn.

Help please!


#2

@Dogn2010,

Sorry it took awhile to reply, but below is a modified snippet of your program. I added some comments and made a few changes.

In your version, each time you check an input device, you may get a different answer. Also, unless you hold down a button, the input value will be 0 (zero).

You should check the IR Button Codes that you are using for directions, I think they may be off a bit.

Good Luck,

Mike


#3

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.


#4