Package nxt :: Module motor :: Class Motor

Class Motor

source code

object --+
         |
        Motor

Instance Methods
 
__init__(self, brick, port)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
set_output_state(self) source code
 
get_output_state(self) source code
 
reset_position(self, relative) source code
 
run(self, power=100, regulated=1)
Unlike update(), set_power() tells the motor to run continuously.
source code
 
stop(self, braking=1)
Tells the motor to stop.
source code
 
update(self, power, tacho_limit, braking=False, max_retries=-1)
Use this to run a motor.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, brick, port)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

update(self, power, tacho_limit, braking=False, max_retries=-1)

source code 

Use this to run a motor. power is a value between -127 and 128, tacho_limit is the number of degrees to apply power for. Braking is wether or not to stop the motor after turning the specified degrees (unreliable). max_retries is the maximum times an internal loop of the braking function runs, so it doesn't get caught in an infinite loop (deprecated, do not use).