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 / 9932
     
   
Subject: 
Micro Scout programming with VLL bar code: HOWTO
Newsgroups: 
lugnet.robotics, lugnet.robotics.microscout, lugnet.robotics.vll
Date: 
Tue, 11 Jan 2000 03:39:21 GMT
Viewed: 
8759 times
  

Summary: * The Micro Scout can be program by flashing a light at it.
         * Use transparencies as a low tech means of doing this.

A more detailed version is available at http://eaton.dhs.org/lego/

The Droid Developers Kit is the first and only MindStorms set that many of
us have either because is was cheap or because it offers R2D2. After
playing with the toy programs built into the brick, the mysterious P mode
cries out yearning to be discovered. The manual tells us to check the web
site for more information but the web side declines to comment stating:
check back in Fall 2000.

Fortunately the Scout SDK has an appendix that shows the codes understood by
the Micro Scout and ties these in to bar codes understood by the Code
Pilot.  Analyzing the bar codes was the first step.

    Step 1:  Understanding VLL

VLL is a binary bar code comprised of: Start bit, Checksum, Data, Stop bit.
A simple example shows encoding VLL message 0 (Motor Forward for both the
Code Pilot and the Micro Scout):

#_##_##_##__#__#__#__#__#__#__#_###      #: Darkness      (usually a bar)
S <-cksm-> <-------data-------> Stop     _: Bright light  (white paper)

A VLL code is 35 time intervals in length. The start bit is 1 unit wide,
the stop bit is 3 units plus the space before it. The checksum and data are
binary digits with 0 being two spaces and a bar while 1 is a space and a
double width bar. The checksum is 3 digits and the data is 7 digits. The
data is the VLL code from 0 to 127. The checksum for VLL code n is:
7-(n+n/4+n/16). This was derived from analysis of about 30 bar codes for
the Code Pilot.

    Step 2:  Talking VLL to the Micro Scout

If you have a Scout, the easiest way is to get the SDK and have the Scout
talk to its little brother. Skip on to the next section to take the easy
way out.

The first step is to determine light and dark. This easiest done by running
the built in Seek Light program (3.) I could not get white paper to
register as light so I photocopied the bar codes onto overhead
transparencies. Ok, I could get a code to register if I held the piece of
paper 4 inches away from a 60 watt light bulb and then, it would only
register once of every dozen scan attempts. I had the best results when
placing the MicroScout on a table directly under a bright light bulb (point
source) and passing the transparency directly over the sensor.

Note that the Micro Scout uses the light level when it is first powered on
to indicate darkness. Ensure the sensor is getting a view of what you are
trying to call black when powering on the Micro Scout to ensure proper
calibration of the bar codes you wish to scan.

The Code Pilot has a standard bar width of 1/32 of an inch. My Micro Scout
could not decode these. I expanded them up to 1/8 inch. This allows 3 large
codes per transparency. Future experimentation may prove a smaller bar code
will suffice. I chose to print the codes 2.5 inches high to ensure the
sensor is registering the bars and not the white above or below the code.
For now, grab a copy of my Postscript program which prints all 29
documented codes the Micro Scout on 10 pages and try it out for yourself.

My Micro Scout bar codes are available at http://eaton.dhs.org/lego/

The next step for me will be to bring an old computer out of retirement and
let it control an LED directly (emulating the scout) so I do not have to
keep all the transparencies around. One thing I assume will be required is
a period of light before the start bit. This will remain theory until I
have time to experiment further or someone else beats me to it.

    Step 3:  Writing a Program

First turn the Micro Scout on and place it in P mode. Remember that it
calibrates its light sensor for darkness when first turned on.

Flash one of the 17 scripting codes at it.  You just started a new program.
Any previous program was erased.  Flash some more scripting codes to create
a longer program.

    Step 4:  Execute the Program

The Run button executes the current program. The script is completed. If
you want to add to a script once it has executed, you have to reenter it
from the beginning. This is not too bad since the longest program you may
enter is only 15 instructions.  The VLL code Run performs the same function
as the Run button.

VLL is disabled while a program or script is running. Reset and Motor Stop
are ignored as far as I can tell. The only way I could interrupt a program
is with the buttons and not my bar codes.

Happy Hacking!
Doug

   
         
     
Subject: 
Re: Micro Scout programming with VLL bar code: HOWTO
Newsgroups: 
lugnet.robotics, lugnet.robotics.microscout, lugnet.robotics.vll
Date: 
Tue, 11 Jan 2000 17:11:40 GMT
Viewed: 
7621 times
  

Have you tried using the computer monitor? ie: display the bar code on your
computer screen and scan along the code? this may make a simple scout/code
pilot programmer possible.

-Rich

In lugnet.robotics, Doug Eaton writes:
Summary: * The Micro Scout can be program by flashing a light at it.
        * Use transparencies as a low tech means of doing this.

A more detailed version is available at http://eaton.dhs.org/lego/

The Droid Developers Kit is the first and only MindStorms set that many of
us have either because is was cheap or because it offers R2D2. After
playing with the toy programs built into the brick, the mysterious P mode
cries out yearning to be discovered. The manual tells us to check the web
site for more information but the web side declines to comment stating:
check back in Fall 2000.

Fortunately the Scout SDK has an appendix that shows the codes understood by
the Micro Scout and ties these in to bar codes understood by the Code
Pilot.  Analyzing the bar codes was the first step.

   Step 1:  Understanding VLL

VLL is a binary bar code comprised of: Start bit, Checksum, Data, Stop bit.
A simple example shows encoding VLL message 0 (Motor Forward for both the
Code Pilot and the Micro Scout):

#_##_##_##__#__#__#__#__#__#__#_###      #: Darkness      (usually a bar)
S <-cksm-> <-------data-------> Stop     _: Bright light  (white paper)

A VLL code is 35 time intervals in length. The start bit is 1 unit wide,
the stop bit is 3 units plus the space before it. The checksum and data are
binary digits with 0 being two spaces and a bar while 1 is a space and a
double width bar. The checksum is 3 digits and the data is 7 digits. The
data is the VLL code from 0 to 127. The checksum for VLL code n is:
7-(n+n/4+n/16). This was derived from analysis of about 30 bar codes for
the Code Pilot.

   Step 2:  Talking VLL to the Micro Scout

If you have a Scout, the easiest way is to get the SDK and have the Scout
talk to its little brother. Skip on to the next section to take the easy
way out.

The first step is to determine light and dark. This easiest done by running
the built in Seek Light program (3.) I could not get white paper to
register as light so I photocopied the bar codes onto overhead
transparencies. Ok, I could get a code to register if I held the piece of
paper 4 inches away from a 60 watt light bulb and then, it would only
register once of every dozen scan attempts. I had the best results when
placing the MicroScout on a table directly under a bright light bulb (point
source) and passing the transparency directly over the sensor.

Note that the Micro Scout uses the light level when it is first powered on
to indicate darkness. Ensure the sensor is getting a view of what you are
trying to call black when powering on the Micro Scout to ensure proper
calibration of the bar codes you wish to scan.

The Code Pilot has a standard bar width of 1/32 of an inch. My Micro Scout
could not decode these. I expanded them up to 1/8 inch. This allows 3 large
codes per transparency. Future experimentation may prove a smaller bar code
will suffice. I chose to print the codes 2.5 inches high to ensure the
sensor is registering the bars and not the white above or below the code.
For now, grab a copy of my Postscript program which prints all 29
documented codes the Micro Scout on 10 pages and try it out for yourself.

My Micro Scout bar codes are available at http://eaton.dhs.org/lego/

The next step for me will be to bring an old computer out of retirement and
let it control an LED directly (emulating the scout) so I do not have to
keep all the transparencies around. One thing I assume will be required is
a period of light before the start bit. This will remain theory until I
have time to experiment further or someone else beats me to it.

   Step 3:  Writing a Program

First turn the Micro Scout on and place it in P mode. Remember that it
calibrates its light sensor for darkness when first turned on.

Flash one of the 17 scripting codes at it.  You just started a new program.
Any previous program was erased.  Flash some more scripting codes to create
a longer program.

   Step 4:  Execute the Program

The Run button executes the current program. The script is completed. If
you want to add to a script once it has executed, you have to reenter it
from the beginning. This is not too bad since the longest program you may
enter is only 15 instructions.  The VLL code Run performs the same function
as the Run button.

VLL is disabled while a program or script is running. Reset and Motor Stop
are ignored as far as I can tell. The only way I could interrupt a program
is with the buttons and not my bar codes.

Happy Hacking!
Doug

    
          
     
Subject: 
Re: Micro Scout programming with VLL bar code: HOWTO
Newsgroups: 
lugnet.robotics
Date: 
Tue, 11 Jan 2000 18:26:40 GMT
Original-From: 
Russell Nelson <nelson@crynwr.&NoMoreSpam&com>
Viewed: 
2625 times
  

Richard Earley writes:
>
> Have you tried using the computer monitor? ie: display the bar code on your
> computer screen and scan along the code? this may make a simple scout/code
> pilot programmer possible.

Even better, flash a big square in the same pattern as a bar code.
Hold the Micro-Scout up to the screen.

--
-russ nelson <sig@russnelson.com>  http://russnelson.com
Crynwr sells support for free software  | PGPok | "Ask not what your country
521 Pleasant Valley Rd. | +1 315 268 1925 voice | can force other people to
Potsdam, NY 13676-3213  | +1 315 268 9201 FAX   | do for you..."  -Perry M.

    
          
     
Subject: 
Re: Micro Scout programming with VLL bar code: HOWTO
Newsgroups: 
lugnet.robotics
Date: 
Tue, 11 Jan 2000 21:03:40 GMT
Viewed: 
2994 times
  

In lugnet.robotics, Russell Nelson <nelson@crynwr.com> writes:
Richard Earley writes:

Have you tried using the computer monitor? ie: display the bar code on your
computer screen and scan along the code? this may make a simple scout/code
pilot programmer possible.

Even better, flash a big square in the same pattern as a bar code.
Hold the Micro-Scout up to the screen.

--
-russ nelson <sig@russnelson.com>  http://russnelson.com
Crynwr sells support for free software  | PGPok | "Ask not what your country
521 Pleasant Valley Rd. | +1 315 268 1925 voice | can force other people to
Potsdam, NY 13676-3213  | +1 315 268 9201 FAX   | do for you..."  -Perry M.

But that requires timing on the part of the computer. A simple display of a bar
code could also be posted to a web page for access by all....

-Rich

    
          
      
Subject: 
Re: Micro Scout programming with VLL bar code: HOWTO
Newsgroups: 
lugnet.robotics
Date: 
Tue, 11 Jan 2000 21:20:54 GMT
Reply-To: 
mattdm@mattdm!nospam!.org
Viewed: 
3213 times
  

Richard Earley <richard.earley@worldnet.att.net> wrote:
But that requires timing on the part of the computer. A simple display of a
bar code could also be posted to a web page for access by all....

Couldn't you use an animated gif?

--
Matthew Miller                      --->                  mattdm@mattdm.org
Quotes 'R' Us                       --->             http://quotes-r-us.org/

     
           
      
Subject: 
Re: Micro Scout programming with VLL bar code: HOWTO
Newsgroups: 
lugnet.robotics.microscout
Date: 
Tue, 11 Jan 2000 22:43:25 GMT
Viewed: 
6485 times
  

In lugnet.robotics, Matthew Miller writes:
Richard Earley <richard.earley@worldnet.att.net> wrote:
But that requires timing on the part of the computer. A simple display of a
bar code could also be posted to a web page for access by all....

Couldn't you use an animated gif?

I just tried this by modifying the PS barcode maker Doug Eaton posted.  I made
one 'bar' and one 'space' as a 256x256 GIF and merged them with gifmerge as
directed by Doug's PS (plus all space lead-in/lead-out).  I played this back at
various speeds with xanim, and none of them triggered my microscout (with the
brightness at 100% and the microscout against the screen).  With my monitor's
60Hz refresh I have to slow it down a bit to make sure the animation speed
dominates rather than the monitor refresh rate.

VLL from the scout is transmitted much faster than a monitor could (without a
dedicated driver of some sort).  It also only works if the bright red LED is at
point-blank range to the microscout's input (my LEGO fiber optics haven't
arrived yet, curses).

If someone could make this work it would be trivial to put up a CGI script that
let people enter scripts and get back a GIF which would program their
microscout.  I don't think monitor brightness is going to be sufficient,
though.

--Ben

     
           
      
Subject: 
Re: Micro Scout programming with VLL bar code: HOWTO
Newsgroups: 
lugnet.robotics.microscout, lugnet.robotics
Date: 
Wed, 12 Jan 2000 03:42:30 GMT
Viewed: 
7545 times
  

The usual caveats with respect to refresh timing apply to all
suggestions about displaying something on a computer screen.

Think about watching a picture of a TV set on TV.  The image seems
to creep and only part of it is displayed at any given time.  Eye strain
is caused by looking at slow scanning monitors.  Electronic  eyes are
even more sensitive to this flashing.  Some have a low-pass filter
in them to discard noise.  The Micro Scout may or may not have this
ability built in.

I hypothesize a refresh rate of 85 Hz and a long persistancy phoshor
monitor would be the baseline for keeping the screen registering as
white between successive scans.

A more accurate way to do this would be to paint the square every
time the screen refreshes during the verical blanking period.  This
is very hardware and OS specific but a generic tool may have already
been created and be floating around the net.  Check if source code
exists for those watches and other devices that are able to read
the flashing screen.  I would be very interested in knowing the
rate at which the watches were programmed and learning if they are
tied to the vertical refresh rate.

I cannot test any of these theories.  I have a laptop with an LCD.
Its refresh characteristics are totally different with a very long
persistancy (1/5 second versus 1/85 second.)


Doug


Ben Jackson wrote:

In lugnet.robotics, Matthew Miller writes:
Richard Earley <richard.earley@worldnet.att.net> wrote:
But that requires timing on the part of the computer. A simple display of a
bar code could also be posted to a web page for access by all....

Couldn't you use an animated gif?

I just tried this by modifying the PS barcode maker Doug Eaton posted.  I made
one 'bar' and one 'space' as a 256x256 GIF and merged them with gifmerge as
directed by Doug's PS (plus all space lead-in/lead-out).  I played this back at
various speeds with xanim, and none of them triggered my microscout (with the
brightness at 100% and the microscout against the screen).  With my monitor's
60Hz refresh I have to slow it down a bit to make sure the animation speed
dominates rather than the monitor refresh rate.

VLL from the scout is transmitted much faster than a monitor could (without a
dedicated driver of some sort).  It also only works if the bright red LED is at
point-blank range to the microscout's input (my LEGO fiber optics haven't
arrived yet, curses).

If someone could make this work it would be trivial to put up a CGI script that
let people enter scripts and get back a GIF which would program their
microscout.  I don't think monitor brightness is going to be sufficient,
though.

--Ben

    
          
      
Subject: 
Re: Micro Scout programming with VLL bar code: HOWTO
Newsgroups: 
lugnet.robotics
Date: 
Tue, 11 Jan 2000 21:34:22 GMT
Original-From: 
Russell Nelson <[nelson@crynwr.]AntiSpam[com]>
Viewed: 
2963 times
  

Richard Earley writes:
> But that requires timing on the part of the computer. A simple display of a bar
> code could also be posted to a web page for access by all....

Relative timing is all that's needed.  All you need is a wait()
routine which waits a consistent amount of time.  Then you call it N
times, based on the width of the bar code you're trying to simulate.

--
-russ nelson <sig@russnelson.com>  http://russnelson.com
Crynwr sells support for free software  | PGPok | "Ask not what your country
521 Pleasant Valley Rd. | +1 315 268 1925 voice | can force other people to
Potsdam, NY 13676-3213  | +1 315 268 9201 FAX   | do for you..."  -Perry M.

    
          
     
Subject: 
Re: Micro Scout programming with VLL bar code: HOWTO
Newsgroups: 
lugnet.robotics
Date: 
Tue, 11 Jan 2000 22:36:35 GMT
Original-From: 
Brian Johnson <bjohnson@c=SayNoToSpam=-cube.com>
Viewed: 
2918 times
  

Perhaps an animated GIF file consisting of a black or white square that alternate
where the timing is specified in the GIF file and executed by the computer.  This
would still be able to be posted on web sites.

Brian

Richard Earley wrote:

In lugnet.robotics, Russell Nelson <nelson@crynwr.com> writes:
Richard Earley writes:

Have you tried using the computer monitor? ie: display the bar code on your
computer screen and scan along the code? this may make a simple scout/code
pilot programmer possible.

Even better, flash a big square in the same pattern as a bar code.
Hold the Micro-Scout up to the screen.

--
-russ nelson <sig@russnelson.com>  http://russnelson.com
Crynwr sells support for free software  | PGPok | "Ask not what your country
521 Pleasant Valley Rd. | +1 315 268 1925 voice | can force other people to
Potsdam, NY 13676-3213  | +1 315 268 9201 FAX   | do for you..."  -Perry M.

But that requires timing on the part of the computer. A simple display of a bar
code could also be posted to a web page for access by all....

-Rich

--
______________________________________________________

  Brian Johnson
  Broadband Network Division
  C-Cube Microsystems, Inc.
  email: bjohnson@c-cube.com
  phone: 1-408-490-6702
    fax: 1-408-490-6570

   
         
   
Subject: 
VLL Transmit for RCX (was: Micro Scout programming with VLL bar code: HOWTO)
Newsgroups: 
lugnet.robotics.rcx.legos, lugnet.robotics.microscout, lugnet.robotics.vll
Date: 
Thu, 13 Jan 2000 02:33:36 GMT
Viewed: 
8282 times
  

In lugnet.robotics, Doug Eaton writes:
Summary: * The Micro Scout can be program by flashing a light at it.
        * Use transparencies as a low tech means of doing this.

A more detailed version is available at http://eaton.dhs.org/lego/

Thanks to Doug's work I was inspired to make the RCX transmit VLL.  You just
hook up a light sensor, initialize it, and then use vll_send(code) to
transmit.  The little red LED on the light sensor blinks furiously.  The Scout
still does this far faster (about 3x) but it probably has some special hardware
(not the least of which is a signaling quality LED).  If the RCX goes any
faster the code becomes a blur and the reject rate skyrockets.

After writing the code I spent almost as much time tarting up my web page about
it with graphics:

http://www.ben.com/LEGO/rcx/vll.html

Feedback welcome, especially from legOS hackers re: my change to dsensor.c to
make this possible

--Ben

 

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