NXTSERVO: this class provides servo motor control functions.
More...
|
| def | __init__ |
| | Initialize the class with the i2c address of your NXTServo. More...
|
| |
| def | command |
| | Writes a specified command on the command register of the NXTServo. More...
|
| |
| def | battVoltage |
| | Reads NXTServo battery voltage in millivolts. More...
|
| |
| def | setSpeed |
| | Sets the speed of a servo Has no effect on continuous rotation servos. More...
|
| |
| def | setPosition |
| | Sets the position of a servo. More...
|
| |
| def | runServo |
| | Runs the specified servo to a specific position at a specified speed. More...
|
| |
| def | storeInitial |
| | Store the current settings of the specified servo to initial/default settings (remembered when powered on) More...
|
| |
| def | reset |
| | Reset all servos to their default settings. More...
|
| |
| def | stopServo |
| | Stop a specific servo This will also completely stop a continuous rotation servo, regardless of its neutral point. More...
|
| |
| def | setNeutral |
| | Sets the default neutral position of a user defined servo. More...
|
| |
| def | haltMacro |
| | Stop the onboard macro on the NXTServo. More...
|
| |
| def | resumeMacro |
| | Resume the onboard macro on the NXTServo. More...
|
| |
| def | gotoEEPROM |
| | Go to a given EEPROM position This command re-initializes the macro environment. More...
|
| |
| def | editMacro |
| | Edit the onboard macro. More...
|
| |
| def | pauseMacro |
| | Temporarily pause the running macro. More...
|
| |
NXTSERVO: this class provides servo motor control functions.
Initialize the class with the i2c address of your NXTServo.
- Parameters
-
| self | The object pointer. |
| nxtservo_address | Address of your NXTServo. |
| def mindsensors.NXTSERVO.battVoltage |
( |
|
self | ) |
|
Reads NXTServo battery voltage in millivolts.
- Parameters
-
| def mindsensors.NXTSERVO.command |
( |
|
self, |
|
|
|
cmd |
|
) |
| |
Writes a specified command on the command register of the NXTServo.
- Parameters
-
| self | The object pointer. |
| cmd | The command you wish the NXTServo to execute. |
| def mindsensors.NXTSERVO.editMacro |
( |
|
self | ) |
|
Edit the onboard macro.
- Parameters
-
| def mindsensors.NXTSERVO.gotoEEPROM |
( |
|
self, |
|
|
|
position |
|
) |
| |
Go to a given EEPROM position This command re-initializes the macro environment.
- Parameters
-
| self | The object pointer. |
| position | The EEPROM position to go to |
| def mindsensors.NXTSERVO.haltMacro |
( |
|
self | ) |
|
Stop the onboard macro on the NXTServo.
- Parameters
-
| def mindsensors.NXTSERVO.pauseMacro |
( |
|
self | ) |
|
Temporarily pause the running macro.
- Parameters
-
| def mindsensors.NXTSERVO.reset |
( |
|
self | ) |
|
Reset all servos to their default settings.
- Parameters
-
| def mindsensors.NXTSERVO.resumeMacro |
( |
|
self | ) |
|
Resume the onboard macro on the NXTServo.
- Parameters
-
| def mindsensors.NXTSERVO.runServo |
( |
|
self, |
|
|
|
servoNumber, |
|
|
|
position, |
|
|
|
speed = None |
|
) |
| |
Runs the specified servo to a specific position at a specified speed.
- Parameters
-
| self | The object pointer. |
| servoNumber | The number of the servo to move (1-8). |
| position | The position to set the servo (1-255). |
| speed | The speed to set the servo (1-255) (not used for continuous rotation servos). |
| def mindsensors.NXTSERVO.setNeutral |
( |
|
self, |
|
|
|
servoNumber |
|
) |
| |
Sets the default neutral position of a user defined servo.
- Parameters
-
| self | The object pointer. |
| servoNumber | The number of the servo you wish to set to the default position. |
| def mindsensors.NXTSERVO.setPosition |
( |
|
self, |
|
|
|
servoNumber, |
|
|
|
position |
|
) |
| |
Sets the position of a servo.
- Parameters
-
| self | The object pointer. |
| servoNumber | The number of the servo to set its position (1-8). |
| position | The position to set the servo (1-255). |
| def mindsensors.NXTSERVO.setSpeed |
( |
|
self, |
|
|
|
servoNumber, |
|
|
|
speed |
|
) |
| |
Sets the speed of a servo Has no effect on continuous rotation servos.
- Parameters
-
| self | The object pointer. |
| servoNumber | The number of the servo to set its speed (1-8). |
| speed | The speed to set the servo (1-255). |
| def mindsensors.NXTSERVO.stopServo |
( |
|
self, |
|
|
|
servoNumber |
|
) |
| |
Stop a specific servo This will also completely stop a continuous rotation servo, regardless of its neutral point.
- Parameters
-
| self | The object pointer. |
| servoNumber | The number of the servo to stop (1-8). |
| def mindsensors.NXTSERVO.storeInitial |
( |
|
self, |
|
|
|
servoNumber |
|
) |
| |
Store the current settings of the specified servo to initial/default settings (remembered when powered on)
- Parameters
-
| self | The object pointer. |
| servoNumber | The number of the servo to save its settings (1-8). |
The documentation for this class was generated from the following file:
- PiStorms/sys/mindsensors.py