Subject:
|
Re: Help me convert this train program to use events (NQC)
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Mon, 28 Nov 2005 05:51:18 GMT
|
Original-From:
|
steve <sjbaker1@airmail.net^IHateSpam^>
|
Viewed:
|
1547 times
|
| |
| |
Jordan Bradford wrote:
> Is this going to work?
One of the most important things with light sensors is calibrating the
threshold level. What works the first time you try it will likely fail
when you run it at different times of the day and with room lights (and
Xmas tree lights!)...you really need the system to calibrate itself.
That works OK if the lighting is pretty constant - but if your train
is running all day, it might even have to adjust it's threshold
gradually throughout the day.
Perhaps it would be better to look for CHANGES in light level rather
than absolute values.
(eg Look for black/white at one end of the track and white/black at
the other. Measure how fast the sensor sees the light brightness
change rather than exactly how bright the light is - and use the
direction of change - positive or negative to determine the direction
the motors should switch to).
> Also, is there anything better to put in the monitor
> block other than a while-loop that does nothing?
Yeah - if you do an empty while loop, it burns CPU time and denies the
other threads the chance to run. Use at least a Wait(1) inside the loop.
|
|
Message is in Reply To:
16 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in Robotics
|
|
|
|