Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Nov 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Control DC Motor using VB Expres 2005

    Hello,

    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!
    Last edited by shounenbat; 08-28-2007 at 08:35 AM.

  • #2
    New Coder
    Join Date
    Aug 2007
    Posts
    74
    Thanks
    3
    Thanked 2 Times in 2 Posts
    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

  • #3
    New to the CF scene
    Join Date
    Nov 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Ok, so which part are you having trouble with? Capturing the key press or sending the appropriate data out the parallel port? or both?
    OracleGuy

  • #5
    New to the CF scene
    Join Date
    Nov 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks for the reply, I have already figured it out.

  • #6
    New to the CF scene
    Join Date
    Nov 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •