PiStorms  4.015
PiStorms Library Reference by mindsensors.com
 All Classes Namespaces Files Functions Variables
mindsensors.PFMATE Class Reference

PFMATE: this class provides motor control functions. More...

Inheritance diagram for mindsensors.PFMATE:

Public Member Functions

def __init__
 Initialize the class with the i2c address of your PFMate. More...
 
def command
 Writes a specified command on the command register of the PFMate. More...
 
def controlBothMotors
 Controls both motors. More...
 
def controlMotorA
 Controls motor A. More...
 
def controlMotorB
 Controls motor B. More...
 

Static Public Attributes

tuple PFMATE_ADDRESS = (0x48)
 Default PFMate I2C Address.
 
int PFMATE_FLOAT = 0
 Constants to specify Float Action.
 
int PFMATE_FORWARD = 1
 Constants to specify Forward Motion.
 
int PFMATE_REVERSE = 2
 Constants to specify Reverse Motion.
 
int PFMATE_BRAKE = 3
 Constants to specify Brake Action.
 
int PFMATE_CHANNEL1 = 1
 Constants to specify Channel 1.
 
int PFMATE_CHANNEL2 = 2
 Constants to specify Channel 2.
 
int PFMATE_CHANNEL3 = 3
 Constants to specify Channel 3.
 
int PFMATE_CHANNEL4 = 4
 Constants to specify Channel 4.
 
int PFMATE_COMMAND = 0x41
 Command Register.
 
int PFMATE_CHANNEL = 0x42
 Channel Registewr.
 
int PFMATE_MOTORS = 0x43
 Motor Define Register.
 
int PFMATE_OPER_A = 0x44
 Motor Operation A Register.
 
int PFMATE_SPEED_A = 0x45
 Motor Speed A Register.
 
int PFMATE_OPER_B = 0x46
 Motor Operation B Register.
 
int PFMATE_SPEED_B = 0x47
 Motor Speed B Register.
 

Detailed Description

PFMATE: this class provides motor control functions.

Constructor & Destructor Documentation

def mindsensors.PFMATE.__init__ (   self,
  pfmate_address = PFMATE_ADDRESS 
)

Initialize the class with the i2c address of your PFMate.

Parameters
selfThe object pointer.
pfmate_addressAddress of your PFMate.

Member Function Documentation

def mindsensors.PFMATE.command (   self,
  cmd 
)

Writes a specified command on the command register of the PFMate.

Parameters
selfThe object pointer.
cmdThe command you wish the PFMate to execute.
def mindsensors.PFMATE.controlBothMotors (   self,
  channel,
  operationA,
  speedA,
  operationB,
  speedB 
)

Controls both motors.

Parameters
selfThe object pointer.
channelCommunication channel to transmit to LEGO PF IR receiver (1-4).
operationAOperation command for motor A (0 = Float, 1 = Forward, 2 = Reverse, 3 = Brake).
speedASpeed of motor A (0-7).
operationBOperation command for motor B (0 = Float, 1 = Forward, 2 = Reverse, 3 = Brake).
speedBSpeed of motor B (0-7).
def mindsensors.PFMATE.controlMotorA (   self,
  channel,
  operationA,
  speedA 
)

Controls motor A.

Parameters
selfThe object pointer.
channelCommunication channel to transmit to LEGO PF IR receiver (1-4).
operationAOperation command for motor A (0 = Float, 1 = Forward, 2 = Reverse, 3 = Brake).
speedASpeed of motor A (0-7).
def mindsensors.PFMATE.controlMotorB (   self,
  channel,
  operationB,
  speedB 
)

Controls motor B.

Parameters
selfThe object pointer.
channelCommunication channel to transmit to LEGO PF IR receiver (1-4).
operationBOperation command for motor B (0 = Float, 1 = Forward, 2 = Reverse, 3 = Brake).
speedBSpeed of motor B (0-7).

The documentation for this class was generated from the following file: