View Full Version : Control DC Motor using VB Expres 2005

08-28-2007, 08:48 AM

Im new to VB 2005 and I would like to know how to make the dc motor accelerate when I press the "a" key and decelerate when I press the "d" key and spacebar to make it to stop. Lets say for example I have 3 speed mode(1,2, and 3), if I press the "a" key twice it will go to number 3 speed and if I press the "d" key one, it will go to number 2 speed, pressing "d" again will go back to 1 speed and finally, pressing spacebar will stop the motor. Im using SCR as controller and pin 2-9 of the parallel port to interface with pc.

Thanks in advance!

Active X
08-28-2007, 10:00 AM
Hi ,

Have you tested VB code snippets ? I think it can really help you .

In your code , where you wanna write the communication code , right click and click "Insert snippet" , Then select "Connectivity and networking" and then "use a serial port to dial a phone number" .

With that code I communicated with a transistor on COM1

08-28-2007, 11:31 AM
Hi, Im using parallel port. I having problem in making a function to make the dc motor accelerate/decelerate on using a designated key. The exact function is stated on my first post.

08-28-2007, 05:16 PM
Ok, so which part are you having trouble with? Capturing the key press or sending the appropriate data out the parallel port? or both?

08-28-2007, 11:09 PM
thanks for the reply, I have already figured it out.

08-29-2007, 10:48 AM
Hi, I have another question. How can I create a counter using LDR as an input? I want my program to count the rpm(rev/min) of the dc motor. Is it possible to use a timer? could you give me any reference code. Thanks.