Controlling DC motors

Hi

I drive  2 dc motors by using command letters (8-forward, 2-backward, 4-left, 6-right) with Hyper Terminal and i have one problem with this.When i holding for example button "8" for a long time after i release the button  motors still drive for a while and then stop. I am using UART module at LPC2138 if someone has experience with this and want to help pls give me advice to reduce the delay.

 

With bdk6’s comment,

maybe you could add a 5th key, like the 5 key for Stop. Then all you need to do is tap the button for a direction and then 5 to stop that move.

Remote control

Yes I could but that is not how supposed to be. I want to make my keyboard exactly like the remote control for toy cars.

The best way would be to write a control program

Instead of continuosly sending keystrokes to the robot from a terminal window, write a small program that sends motorStart motorStop commands. Motor start would be sent when the forward key is pressed and motor stop could pe sent when the key is released. This could easily be written in something like Processing, which should be easy to understand if you have already programmed an Arduino.

LPC

Hi I am working with LPC2138 and i have a small program code who receive ascii from hyper terminal like"8" for forward and i work with interrupt. When one char is in Receiver Buffer Register (U0RBR) i activate the motor depend of the pressed button and when the button is released motor stop and the program is waiting for another press of button. This works only when i press buttons for short moments but when i hold them for a while and release it keeps driving for 3, 5 or 10 sec depends of how long i hold the button.