Subject:
|
Re: #define-ing stuff for Chibots
|
Newsgroups:
|
lugnet.org.us.laflrc
|
Date:
|
Mon, 3 Oct 2005 19:15:15 GMT
|
Viewed:
|
789 times
|
| |
| |
In lugnet.org.us.laflrc, Steve Hassenplug wrote:
> Talking about Chibots Maze event, Davis, Brian L. wrote:
>
> > I'm developing on a black maze on white background,
> > flagging everything that should matter to make a
> > "negative copy" of the software for later. Ugh.
>
> I'm not totally sure about this, but try playing around with #define
I have, and it helps a lot. For instance, when comparing the raw light sensor
values to some limit, I #define "<" to be "LIGHTER_THAN", for instance. That
makes switching all those points very easy in the code, I need only change two
#defines near the start of the code. Likewise, the NQC / standard firmware has a
command that sets the global motor state, specificly directions, which can help
on some of this as well.
Part of the problem is that the standard firmware is a little too slow, so
instead of a repeatedly-executed "if-then" structure in a loop, for some things
I use event monitoring (which can kick in in 3 ms, as opposed to 2-3 ms for the
tightest loop with a "if then" I can come up with). Even better, tasks that are
just waiting for events to trigger can sit there 'active' in a Wait() state, not
slowing the standard firmware. To make a "negative" of these events, I can reset
the event descriptions (instead of watching for, say, a high event, watch for a
low one). But there are places in the code where I've used the actual event
state, and *those* I think I've got to "flip" by hand.
the long and the short of it, I've done some things to make sure it's easy to
invert the contrast that the robot runs on... but that's just in theory, and you
know how well theory works in practice...
> > What is the maximum incline in the advanced maze?
>
> a hump that's about 2 inches high, in
> the middle, and 6 to 8 inches long.
Not too bad. As long as the robot doesn't have to turn on it (that *would*
hamstring, in an almost literal sense, my current design).
--
Brian Davis
|
|
Message is in Reply To:
| | #define-ing stuff for Chibots
|
| (...) I'm not totally sure about this, but try playing around with #define In one language I use, the compiler will totally take out the variable, and put in the defined value, before compiling the program. I assume that's how it should work in C (...) (19 years ago, 3-Oct-05, to lugnet.org.us.laflrc)
|
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|