Subject:
|
Re: Rotation Sensor Values
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Mon, 24 Jul 2000 13:59:12 GMT
|
Viewed:
|
1713 times
|
| |
| |
On Mon, 24 Jul 2000, Andy Gombos wrote:
> I was reading about rotation sensors for legOS for a new robot, and
> thought I'd try it out. So, I made a simple program that would show
> rotation sensor values on the display. What I got was not what I
> expected. I have never used the rotation sensors in legOS before, so I
> do not know if this behavior was expected. Anyway, I got values of
> 9999, -9999, 64, and -64 (more that once). I think that these values
> correspond to the RAW values that I got from switchinf quadrants in
> the sensor. Are these the expected values, or are you supposed to get
> 0,1,2, -5,2, like in the regular lego firmware?
Andy-
Have you set up the rotation sensors correctly? You need to do a few
things before you get reasonable values for the rotation sensor.
1) use ds_active(&SENSOR_1) to turn on the sensor.
2) use ds_rotation_on(&SENSOR_1) to turn on the rotation processing in the
kernel.
3) use ds_rotation_set(&SENSOR_1, int X) to set the sensor to X. I believe
that the default for this is undefined, so unless you use rotation set at
least once, you could easily get an undefined value > 9999 or < -9999.
Once you've done all that, what you should see is just a counter, noting
the number of sixteenths of rotations that have occurred. (i.e., when the
counter reads 16, one rotation will have occurred.)
Hope that helps- please let us know if you still have problems-
Luis
-----------------------------------------------------------------------
"Summertime... and the living is easy...
fish are jumping and the cotton is high...
So hush, little baby, baby don't you cry."
-Ella
-----------------------------------------------------------------------
|
|
Message has 1 Reply: | | Re: Rotation Sensor Values
|
| Well, I do not know if I have to have code to display the values. I do not get anything on screen when I run this code. If I put a loop, and with every loop, the sensor value is being displayed, then I get the values mentioned before. I run the (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)
|
Message is in Reply To:
| | Rotation Sensor Values
|
| I was reading about rotation sensors for legOS for a new robot, and thought I'd try it out. So, I made a simple program that would show rotation sensor values on the display. What I got was not what I expected. I have never used the rotation sensors (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)
|
16 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
|
|
|
|