Hey all. I've got a barcode reader that gives:
"A series of pulses with widths proportional to the widths of the bar code elements being scanned. A low output represents a bar, and a high output represents a space. The frequency of the pulses depends on the density of the symbol being scanned."
--LT 1800 Product Reference Guide
How would I read this? I've tried reading it as serial, but I don't think that's how it was meant to be done. Right now i'm toying with pulseIn HIGH and LOW, but I have a feeling that:
duration1 = pulseIn(barCode, HIGH);
duration2 = pulseIn(barCode, LOW);
misses a whole LOW, HIGH series in between, based on its description. If the first pulseIn waits for a HIGH, then counts until it hits a LOW, the next pulseIn wouldn't start on that LOW, it would start on the next LOW, right?
I mean, with that in my loop, I get about half the number of HIGH/LOW that I should for a barcode.
How *should* I do this? Is the PWM feature on the output only, or is there some kind of PWM input functionset?