To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.pbforthOpen lugnet.robotics.rcx.pbforth in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / pbFORTH / 180
179  |  181
Subject: 
RE: Long range IR mode.
Newsgroups: 
lugnet.robotics.rcx.pbforth
Date: 
Thu, 11 Nov 1999 13:43:54 GMT
Viewed: 
1686 times
  
Great, much more generalized code.  What are the >R and R> words BTW?

The >R and R> words are used as little helpers. The put (or get) the
top element of the data stack to the return stack. As long as you dont
fiddle with the return stack between uses, they are a great way to
do this. The alternative way to code it would be:

: RANGE_SET ( f -- ) \ non-zero is long, 0 is short
  FFB7 DUP C@ ROT
  IF   FFFE AND
  ELSE 0001 OR
  THEN SWAP C! ;

Which is a bit cleaner. I keep forgetting if ROT brings the deepest of
three elements out...

Did FFB7 C@ . and found the contents to already FE, as in, it appears
that
the default IR mode is indeed Long to start with.  Seems like the
effective
range is much shorter than let's say NQC's transmission range.  Can you
confirm this?

If this is true, is there an additional ROM call we have to do to set
the
operating IR mode to Long, or does PB Forth handle IR transmissions a
different way that shortens the effective IR range?

There are, in fact, two calls into the ROM to set the range, I'll roll
them into the next release. They do exactly what we are doing here. In
fact, I'll just use the RANGE_SET word here as a prototype, OK?

Can you do some experiments to verify the range issue? How far CAN you
let a pbForth brick get from the IR tower?

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 is in Reply To:
  Re: Long range IR mode.
 
(...) Great, much more generalized code. What are the >R and R> words BTW? Did FFB7 C@ . and found the contents to already FE, as in, it appears that the default IR mode is indeed Long to start with. Seems like the effective range is much shorter (...) (25 years ago, 11-Nov-99, to lugnet.robotics.rcx.pbforth)

6 Messages in This Thread:

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

Custom Search

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