CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2007
    Posts
    2

    real time parallel port data

    Hi All - I'm trying to write a program that reads data fed directly into the parallel port from a reed switch on my bike (a pc based bike computer basically). There is no external circuitry - the opening and closing of the switch toggles pin6 on my parallel port.
    Basically I'm wondering if anyone has tried something similar and whether they can give me some advice on accurately reading the data. I think I get alot of bounce from the switch giving me multiple toggles for one open-close of the switch and I don't know if I'm missing some inputs through timer delays etc. I'm a novice to VB in the sense that everything I know is self taught. Can anyone suggest a robust method of collecting accurate data without going back and adding extra circuitry?
    Thanks
    Cal

  2. #2
    Join Date
    Mar 2005
    Posts
    226

    Re: real time parallel port data

    Robust with out extra circuitry? Unless you want to program in assembly or write a device driver, not really.

    Since your switch is mechanical, it will bounce(multiple open/close) until it settles. VB is not a real time language. You might be able to kludge it, but you will have to manually tweek it. Try adding a timer with a 200 ms delay. Play around with the delay time until your switch stops bouncing.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured