On Mon, Jan 28, 2008 at 3:57 PM, James Newton wrote: > I'm still really interested to hear from anyone who does barcode readers: > Can an LED be used to generate a pattern of light and dark that a barcode > wand would see as if it were a barcode? Having done barcodes in a previous job, I'm going to say that only a very low-end barcode reader (like a CueCat -- http://en.wikipedia.org/wiki/CueCat -- or other wand-based barcode scanner) would be able to read a "barcode" from an LED. The information is encoded in the relative width and spacing of the bars, and will translate into a time sequence only by knowing the location / velocity of the scanning laser / LED. For a high-end mirrorwheel scanner, this scanning is non-linear (the ends of the scan are faster than the middle of the scan), but not too hard to figure out. For a lower-end vibrating vane, the scan is again non-linear, but somewhat harder to figure out. For a "bottom-end" wand scanner (for example, http://instruct1.cit.cornell.edu/courses/ee476/FinalProjects/s2004/mtf23/BarcodeScanner/index.htm ATMega based, not PIC based -- sorry!) or a CueCat, the scan is assumed to be linear (the movement of your hand), with very simple mechanical and processing requirements. Thus, relative time is directly translated into bar width / spacing. If you really want to transfer a complicated message via status LED, it seems you'd be better off using a simple RS232 protocol. Make a definition that there must be a quiet period (say 1 second) between messages (I'm going to assume that the message is repeated, or that different messages are going to be sent in sequence), followed by a standard RS232 encoding. The quiet period makes sure you are synchronized to the message. For receiving, all you need is a photodiode and a processor. Note that this assumes that the status LED is constantly ON (at least visually). In projects around here, our status LED fades in to full brightness, then goes back to dark in a 1-second cycle. A constantly ON LED just says that power is being applied and the bit is set, a cycling LED says that processing is actually taking place. Although, you could use a constantly ON LED as an error indication, and then look for the RS232 stream with your detector. Bill -- Psst... Hey, you... Buddy... Want a kitten? straycatblues.petfinder.org -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist