To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 9525
9524  |  9526
Subject: 
RE: how does a bar code reader work?
Newsgroups: 
lugnet.robotics, lugnet.trains
Date: 
Thu, 30 Dec 1999 15:15:56 GMT
Viewed: 
1051 times
  
Ben wrote:

This is going to be tricky without real arrays.  LegOS may be the only option.

Hmmm, this might be another practical pbForth application. I don't have time
right now...

<snipped excellent  barcode type description>

Maybe I'll print some Code 39 and see if I can write some NQC to scan it with a
light sensor.  You'd need a full time counter task to simulate a fast clock.
Then you wait for a quiet leading zone and the initial set of light->dark,
dark->light, light->dark transitions.  This gives you baselines for the pulse
widths.  Then you measure each set of transitions and decide if you saw a wide
or a narrow bar/gap and decode.  When you see the end symbol check the checksum
and then beep pleasantly at about 1600Hz.  :-)

I'm not sure about the clock thing. Any single sensor is sampled at about 333 Hz.
If you write some pbForth coe to sample in a tight loop, you will get a bit pattern
which you can then guess the time from. Time is relative anyways, since the scanning
speed is changed as you drag the pointer across the code...the marker bars at either
end of the code are there to provide a reference and assume you don't change
your scan rate too much.

pbForth has access to 10msec timers inside the RCX.

Cheers,

Ralph Hempel - P.Eng

--------------------------------------------------------
Check out pbFORTH for LEGO Mindstorms at:
<http://www.hempeldesigngroup.com/lego/pbFORTH>
--------------------------------------------------------
Reply to:      rhempel at bmts dot com
--------------------------------------------------------



Message has 1 Reply:
  Re: how does a bar code reader work?
 
On the lego website they have RIS 1.5 programming hints. I just saw that there is a card reader that scans slips of paper with lines on it. I was thinking that the same idea could be used for these trains, since lego already has the basic (...) (24 years ago, 1-Jan-00, to lugnet.robotics)

Message is in Reply To:
  Re: how does a bar code reader work?
 
This is going to be tricky without real arrays. LegOS may be the only option. You'll be looking for a start symbol (maybe just one framing bit, sometimes a legal character in the barcode set and sometimes just a pattern). Once you identify it you (...) (24 years ago, 30-Dec-99, to lugnet.robotics, lugnet.trains)

11 Messages in This Thread:






Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR