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 / 22679
22678  |  22680
Subject: 
Re: Competitive MINDSTORMS: try again...
Newsgroups: 
lugnet.robotics
Date: 
Fri, 20 Aug 2004 16:29:01 GMT
Viewed: 
1250 times
  
In lugnet.robotics, David Perdue wrote:
In lugnet.robotics, Steve Hassenplug wrote:
At no point will the reading on LBump go above 'thresh', unless the light sensor
is pointing towards a white robot.  So, the loop:
until(LBump==thresh+5);
will never exit (unless you see a white robot, in which case you DON'T want it
to exit, but it will)

This is actually incorrect - I see where you're getting confused. You are
thinking that the Calibrate2() function is always running, and the
"thresh=LBump;" is always being updated, correct?

No, that's not what I was thinking.  I see Calibrate and Calibrate2 only run at
the beginning of the program.


It provides the program
with a reading of the light in the room once, but never again.

Therefore, in this line of code:

if(LBump<=thresh | LBump==100)

the first part says that if LBump is less than the value of thresh


Actually, it says that if LBump is less than OR EQUAL TO the value of thresh...

Which means if the light in the room NOW is the same (or less than) the light in
the room when the program started running, then "we have the opponent in sight"



Likewise, if LBump starts to read that it is equal to
thresh+5--a value which is taken once and will never change--it knows that it
has lost sight of the opponent.


So, if the light in the room is brighter NOW then when the program started, "it
has lost sight of the opponent"



Message has 1 Reply:
  Re: Competitive MINDSTORMS: try again...
 
(...) Yes, that's correct. (...) There is one piece of missing information you've missed that is causing the confusion: When the program starts, the program doesn't put the normal light value of the room into the variable thresh - read this from the (...) (20 years ago, 20-Aug-04, to lugnet.robotics)

Message is in Reply To:
  Re: Competitive MINDSTORMS: try again...
 
(...) This is actually incorrect - I see where you're getting confused. You are thinking that the Calibrate2() function is always running, and the "thresh=LBump;" is always being updated, correct? You see, Calibrate2() is only run just once, and (...) (20 years ago, 20-Aug-04, to lugnet.robotics)

29 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