To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 1263
1262  |  1264
Subject: 
Re: SPIRIT SetSensorMode "slope" parameter
Newsgroups: 
lugnet.robotics
Date: 
Wed, 9 Dec 1998 21:23:35 GMT
Original-From: 
Peter Tomcsanyi <TOMCSANY@INTERNETavoidspam.SK>
Viewed: 
794 times
  
At 15:47 9.12.1998 GMT, Bob Miller wrote:
One particular parameter of the SetSensorMode command is somewhat obscure: • the
"Slope" parameter.  The Lego SDK doesn't explain this very well in my view,
and I haven't been able to get it to do anything particularly useful yet. • I'm
posting this message to see if anyone here has a good explanation of how • this
parameter is supposed to work, and how you are supposed to use it.

The SDK says that Slope pertains to Boolean mode only.   If you set Slope=0,
Boolean mode acts in the normal way, like the Touch sensor: • 1=(RAW<45%of1023),
0=(RAW>55%of1023).  If you set Slope to a value in range of 1..31, the SDK
implies that this value of slope is the increment needed to get a change in
the Boolean state.   I sort of expected that if you set Slope=10, then a
change of 10 in the value of RAW would change Boolean from a 1 to a 0 or a 0
to a 1.  However, I don't actually see behavior like that.

My understanding of "slope" is that it is the approximation of derivative
of the function "raw value"= f(t), i.e. it is the value for df/dt.
This means that if you set the slope to 10, then the boolean value changes
from 0 to 1 if the eraw value increases  by 10 in 1 unit of time or it
increases by 20 in 2 units of time etc. And the boolean value changes from
1 to 0 if the raw value decreases by 10 in 1 unit of time. I do no know
what is a unit of time used here maybe 1s or some shorter time which is
used internally to poll the sensor.
Thus the slope does not define how much the value has to change for a
trasition of boolean value should occur, but it defines how *quickly* the
change has to occur.
I did not have time to play with the RCX nor I am decoding the ROM,
therefore I may be wrong.

        Best regards,

Peter Tomcsanyi



Message is in Reply To:
  SPIRIT SetSensorMode "slope" parameter
 
Hi all- I've been writing an article about programming the RCX using Delphi and the SPIRIT OCX, to appear in MicroComputer Journal Magazine in my Delphi in the Laboratory series. I've written an example program, to be published with source code, (...) (26 years ago, 9-Dec-98, to lugnet.robotics)

6 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