To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 1162
1161  |  1163
Subject: 
rotation sensor problem, again...
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Wed, 14 Jun 2000 23:53:21 GMT
Viewed: 
1059 times
  
Just when you thought it was all fixed. I use the following code:

ds_active(&SENSOR_2);
ds_rotation_on(&SENSOR_2);
ds_rotation_set(&SENSOR_2, 0);

to setup a rotation sensor. Immediately after calling ds_rotation_set(),
and /without moving the sensor/, the value read is not 0 (as it should be)
but 1. If I call ds_rotation_set(&SENSOR_2,2), then the code is
initialized not to 2, but to 3. Or, after downloading a new kernel, I get
the same behavior except with -1 or -2. There was a similar problem in the
old code that would occasionally initialize the rotation sensors to
whatever they were set to, plus 2. Anyone have any clues on why this is
happening? I knew the old code inside and out, but never could track down
the bug... is it going to be the same this time?
Luis

-----------------------------------------------------------------------

           "Going to California with an aching in my heart.
               Someone told me there's a girl out there
            with love in her eyes and flowers in her hair."
-Led Zeppelin, "Going to California"

-----------------------------------------------------------------------



Message has 2 Replies:
  Re: rotation sensor problem, again...
 
(...) That you see values -1, 2, and 1 sounds like the current state of the rotation sensor is not considered when when the sensor is reset, like it is reset to a state of 0 when it should be reset to the current state of the sensor, like 0, 1, 2, (...) (24 years ago, 15-Jun-00, to lugnet.robotics.rcx.legos)
  Re: rotation sensor problem, again...
 
I had the same problem and I solved it with a msleep(50). msleep(10) is not enough. (...) (24 years ago, 3-Jul-00, to lugnet.robotics.rcx.legos)

4 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR