|Question: setMotorDirection(theMotors, direction);
|Page 1 of 1|
|Author:||larzw [ Wed Apr 04, 2007 10:13 am ]|
|Post subject:||Question: setMotorDirection(theMotors, direction);|
I'm trying to use the function:
What do i use for the direction parameter if i'd like to reverse the natural direction of the motor? (i assume this is what the function does)
|Author:||vnguyen [ Wed Apr 04, 2007 2:04 pm ]|
|Post subject:||Re: Question: setMotorDirection(theMotors, direction);|
You should actually use this function:
Obviously, if you don't want to flip motorA then you should set it to the motor you want to flip. Hope this helps..
|Author:||Dick Swan [ Wed Apr 04, 2007 2:53 pm ]|
Mindstorms bricks can also be programmed using the graphical Robolab system. Robolab shares similar firmware with RobotC for both the RCX and NXT bricks.
'setMotorDirection' is a legacy feature required for Robolab compatibility. In Robolab, there's a series of common functions for manipulating motors that was the original RCX motor functions commands. Some of these functinos are not "natural" for the NXT and some emulation and conversion "glue" code was written to behave as close as possible to the legacy functions.
"setMotorDirection" is one of these legacy compatibility functions and it is not recommended for use in new RobotC programs.
To change motor direction you use either positive or negative power
The 'motorReflected' function is a nifty feature to chang the motor performance. Suppose you've got your robot built and you find the configuation is that one (or more) motors ends up moving in the logically opposite direction due to mechanical orientatino of the motor. On the RCX, this was easy to fix -- you simply rotated the black connector a quarter turn and this would reverse the way the pair of wires was connected to the RCX.
Connectors on the NXT are polarized and you can't use the RCX trick of physically flipping the way the wires are connected. So, the variable "bMotorReflection' is used to achieve the same effect in software.
|Page 1 of 1||All times are UTC - 5 hours [ DST ]|
|Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group