Subject:
|
Re: Light sensor initialization?
|
Newsgroups:
|
lugnet.robotics.rcx
|
Date:
|
Tue, 13 Jul 1999 23:49:18 GMT
|
Viewed:
|
1653 times
|
| |
| |
I haven't done that yet. But if you're doing a line follower, I would suggest
the following:
1. First, build the line follower in such a way that it can rotate in place and
make the light sensor sweep out a circle on the ground as it rotates.
2. Mesaure how long it takes to rotate in a full circle.
3. Make your program start by rotating a little more than one full circle (to
account for battery voltage and motor variations). While it's doing this first
full circle, watch the light sensor and keep track of the highest and lowest
light readings you get.
4. If your robot was started on a line, it will sweep across the line once or
twice during this initial rotation, and the high and low readings will differ
by a significant amount. Split the difference between highest and lowest and
store this in a variable. This will be your "cutoff". Continue rotating until
you hit the line again and start tracking.
5. If the robot wasn't started on a line, the high and low readings will be
fairly close. Subtract a little from the low reading and use this as your
"cutoff". Stop rotating and move forward or search randomly until you find a
line.
In lugnet.robotics.rcx, Tim Rueger writes:
> This should be an FAQ at this point, but
> I'm having trouble tracking down an answer
> in the LUGNET archives.
>
> I'd like my 'bot to measure ambient light
> levels, and make light/gray/dark decisions
> based on those levels.
>
> For instance, Dave Baum's line follower 'bot
> code defines gray and dark thusly:
>
> #define CUTOFF 55
> #define STOP 48
>
> I'd like to avoid hard-coding these numbers.
> Has any one done this?
>
> Thanks,
> -Tim
|
|
Message is in Reply To:
| | Light sensor initialization?
|
| This should be an FAQ at this point, but I'm having trouble tracking down an answer in the LUGNET archives. I'd like my 'bot to measure ambient light levels, and make light/gray/dark decisions based on those levels. For instance, Dave Baum's line (...) (25 years ago, 13-Jul-99, to lugnet.robotics.rcx)
|
10 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|