Subject:
|
Re: Problem in program
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Mon, 12 May 1997 15:22:00 GMT
|
Original-From:
|
King, Terry <Terry.King@fmr.com!saynotospam!>
|
Viewed:
|
1373 times
|
| |
| |
Terry Gathright wrote:
> Terry
> I copied your program and am having the same problem with the printing
> to the LCD.
> I was wondering if you fixed the problem and if you could send me your
> corrected code? I can't write code verry well yet but can follow
> instructions.
Terry,
Don't feel bad, I'm in the same boat on writing that code. But, thanks
to everyone's help, I've been learning.
Chris Hackett and Pandit Panburana had a good tip on fixing the problem
with getting the printf message to LCD consistently. The problem was
doing the printf in the "if (digital (15))" as opposed to running the
printf right after "while (digital (15))".
Try this:
while (digital (15))
bk(2);
printf ("Left object detected\n");
(And the same for the right sensor.)
This way, the printf statement goes to the display right away and every
time. I'm still playing with this though...there's a minor problem
where, before either input is triggered, both printf statements are
trying to showup at the sametime though the motor ports are not
triggered.
Chris Hackett has pointed me in another direction using variables and
separate processes. So far, I've been less successful with that pgrm,
but I'm still working on it.
I'll keep you posted.
Terry King.
Terry.King@fmr.com
|
|
Message has 1 Reply: | | Re: Problem in program
|
| K> to running the printf right after "while (digital (15))". Try K> this: K> while (digital (15)) K> bk(2); K> printf ("Left object detected\n"); I think you want this to read: while (digital (15)) { bk(2); printf ("Left object detected\n"); } K> (...) (27 years ago, 12-May-97, to lugnet.robotics.handyboard)
|
2 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|