Subject:
|
Re: Advantage on motor change direction?
|
Newsgroups:
|
lugnet.robotics.rcx.robolab
|
Date:
|
Mon, 7 Mar 2005 02:07:00 GMT
|
Viewed:
|
9094 times
|
| |
| |
In lugnet.robotics.rcx.robolab, Thomas Johnson wrote:
<snip>
> This topic actually brings up problem I keep running into. Is there any way to
> programatically detect which direction a motor is set to turn?
Um, you can't programmatically detect *in advance* which direction the motor is
*set to turn* because that's determined by hardware, namely, by the orientation
of the electric cable ends on the motor and on the RCX. And as everyone knows,
the cable ends often get turned around unexpectedly at times.
However, once the motor starts turning you can determine the direction it is
turning if you rig it up to a rotation sensor and set up a task to monitor the
rotation sensor continuously. The counts will be increasing if the motor turns
one way and the counts will be decreasing if the motor turns the other way.
But as to which direction is "forward" and which direction is "backward" is set
outside of the program.
CS
|
|
Message is in Reply To:
| | Re: Advantage on motor change direction?
|
| (...) This command is useful when you don't already know what direction a motor is going. Consider the following contrived example: A Robot w/a single light sensor is supposed to drive back and forth between two black lines. Additionally, this robot (...) (20 years ago, 3-Mar-05, to lugnet.robotics.rcx.robolab)
|
4 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|