Subject:
|
Re: multiplexor and legOS
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Mon, 4 Feb 2002 07:14:28 GMT
|
Viewed:
|
2255 times
|
| |
| |
On Sun, 3 Feb 2002, Mark Falco wrote:
> well anyone who looked at the code I attached may have notcied that I had one
> of the msleeps commented out. Oops, with this now uncommented I at least see
> the second and third light sensors pulse on, but only for an extremely short
> time. Suring the 1s sleep that follows selecting the port it is the 1st light
> sensor that is always lit. Any thoughts would still be appreciated, if/when I
> figure it out I'll be sure to post what I was doing wrong. I've now got a
> rotation sensor hooked up to a regular sensor port and am using it to vary the
> pulse length :)
Don't ask me for a cite, but I seem to remember something about msleep
only having 20ms granularity. If that's the case, your msleep(10) is
either not sleeping at all or is sleeping 20ms, either one of which could
cause problems.
I'd suggest at the very least verifying your timing using sys_time in the
code. If msleep indeed isn't accurate enough, then you could make some
kind of busy-waiting loop.
--
"From now on, we live in a world where man has walked on the moon.
And it's not a miracle, we just decided to go." -- Jim Lovell
Mike Ash - <http://www.mikeash.com/>, <mailto:mail@mikeash.com>
|
|
Message has 2 Replies: | | Re: multiplexor and legOS
|
| (...) Thanks, I'd suspected that msleep might not be very accurate but never considered that it's true granularity could be so large. I did a quick test with my current configuration and when I asked msleep to sleep for 12ms it slept for 20. This (...) (23 years ago, 4-Feb-02, to lugnet.robotics.rcx.legos)
| | | Re: multiplexor and legOS
|
| #include <sys/time.h> void systime_set_timeslice (unsigned char slice); include/sys/time.h:43-45: #ifdef CONF_TM #define TM_DEFAULT_SLICE 20 file://!< default multitasking timeslice #endif hope that helps, Albert "Michael J Ash" (...) (23 years ago, 4-Feb-02, to lugnet.robotics.rcx.legos)
|
Message is in Reply To:
| | Re: multiplexor and legOS
|
| well anyone who looked at the code I attached may have notcied that I had one of the msleeps commented out. Oops, with this now uncommented I at least see the second and third light sensors pulse on, but only for an extremely short time. Suring the (...) (23 years ago, 3-Feb-02, to lugnet.robotics.rcx.legos)
|
19 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
|
|
|
|