|
-
March 11th, 2007, 11:44 AM
#1
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
-
March 11th, 2007, 06:55 PM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|