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

LineLeader: this class provides PiStorms specific interface for LineLeader-v2 and NXTLineLeader. More...

Inheritance diagram for MsDevices.LineLeader:

Public Member Functions

def __init__
 Initialize the class with the i2c address of your LineLeader. More...
 
def command
 Writes a value to the command register. More...
 
def White_Cal
 Calibrates the white value for the LineLeader. More...
 
def Black_Cal
 Calibrates the black value for the LineLeader. More...
 
def Wakeup
 Wakes up or turns on the LEDs of the LineLeader. More...
 
def Sleep
 Puts to sleep, or turns off the LEDs of the LineLeader. More...
 
def ReadRaw_Calibrated
 Reads the eight(8) calibrated light sensor values of the LineLeader. More...
 
def ReadRaw_Uncalibrated
 Reads the eight(8) uncalibrated light sensor values of the LineLeader. More...
 
def steering
 Read the steering value from the Lineleader (add or subtract this value to the motor speed) More...
 
def average
 Read the average weighted value of the current line from position from the Lineleader. More...
 
def result
 Reads the result of all 8 light sensors form the LineLeader as 1 byte (1 bit for each sensor) More...
 
def getSetPoint
 Reads the setpoint register. More...
 
def setSetPoint
 Writes the Setpoint register. More...
 
def setKP
 Write the Kp value to the Lineleader. More...
 
def setKI
 Write the Ki value to the Lineleader. More...
 
def setKD
 Write the Kd value to the Lineleader. More...
 
def setKPfactor
 Write the Kp factor value to the Lineleader. More...
 
def setKIfactor
 Write the Ki factor value to the Lineleader. More...
 
def setKDfactor
 Write the Kd factor value to the Lineleader. More...
 
def getKP
 Read the Kp value from the Lineleader. More...
 
def getKI
 Read the Ki value from the Lineleader. More...
 
def getKD
 Read the Kd value from the Lineleader. More...
 
def getKPfactor
 Read the Kp factor value to the Lineleader. More...
 
def getKIfactor
 Read the Ki factor value to the Lineleader. More...
 
def getKDfactor
 Read the Kd factor value to the Lineleader. More...
 

Static Public Attributes

int LL_ADDRESS = 0x02
 Default Lineleader I2C Address.
 
int LL_COMMAND = 0x41
 Command Register.
 
int LL_STEERING = 0x42
 Steering Register. More...
 
int LL_AVERAGE = 0x43
 Average Register. More...
 
int LL_RESULT = 0x44
 Steering Register. More...
 
int LL_SETPOINT = 0x45
 Setpoint Register.
 
int LL_Kp = 0x46
 KP Register.
 
int LL_KI = 0x47
 Ki Register.
 
int LL_KD = 0x48
 Kd Register.
 
int LL_KPfactor = 0x61
 Kp factor Register.
 
int LL_KIfactor = 0x62
 Ki factor Register.
 
int LL_KDfactor = 0x63
 Kd factor Register.
 
int LL_CALIBRATED = 0x49
 
int LL_UNCALIBRATED = 0x74
 

Detailed Description

LineLeader: this class provides PiStorms specific interface for LineLeader-v2 and NXTLineLeader.

Constructor & Destructor Documentation

def MsDevices.LineLeader.__init__ (   self,
  port,
  address = LL_ADDRESS 
)

Initialize the class with the i2c address of your LineLeader.

Parameters
selfThe object pointer.
portThe PiStorms bank.
addressAddress of your LineLeader
Remarks

Member Function Documentation

def MsDevices.LineLeader.average (   self)

Read the average weighted value of the current line from position from the Lineleader.

Parameters
selfThe object pointer.
def MsDevices.LineLeader.Black_Cal (   self)

Calibrates the black value for the LineLeader.

Parameters
selfThe object pointer.
def MsDevices.LineLeader.command (   self,
  command 
)

Writes a value to the command register.

Parameters
selfThe object pointer.
commandValue to write to the command register.
def MsDevices.LineLeader.getKD (   self)

Read the Kd value from the Lineleader.

Parameters
selfThe object pointer.
def MsDevices.LineLeader.getKDfactor (   self)

Read the Kd factor value to the Lineleader.

Parameters
selfThe object pointer.
def MsDevices.LineLeader.getKI (   self)

Read the Ki value from the Lineleader.

Parameters
selfThe object pointer.
def MsDevices.LineLeader.getKIfactor (   self)

Read the Ki factor value to the Lineleader.

Parameters
selfThe object pointer.
def MsDevices.LineLeader.getKP (   self)

Read the Kp value from the Lineleader.

Parameters
selfThe object pointer.
def MsDevices.LineLeader.getKPfactor (   self)

Read the Kp factor value to the Lineleader.

Parameters
selfThe object pointer.
def MsDevices.LineLeader.getSetPoint (   self)

Reads the setpoint register.

Parameters
selfThe object pointer.
def MsDevices.LineLeader.ReadRaw_Calibrated (   self)

Reads the eight(8) calibrated light sensor values of the LineLeader.

Parameters
selfThe object pointer.
def MsDevices.LineLeader.ReadRaw_Uncalibrated (   self)

Reads the eight(8) uncalibrated light sensor values of the LineLeader.

Parameters
selfThe object pointer.
def MsDevices.LineLeader.result (   self)

Reads the result of all 8 light sensors form the LineLeader as 1 byte (1 bit for each sensor)

Parameters
selfThe object pointer.
def MsDevices.LineLeader.setKD (   self)

Write the Kd value to the Lineleader.

Parameters
selfThe object pointer.
def MsDevices.LineLeader.setKDfactor (   self)

Write the Kd factor value to the Lineleader.

Parameters
selfThe object pointer.
def MsDevices.LineLeader.setKI (   self)

Write the Ki value to the Lineleader.

Parameters
selfThe object pointer.
def MsDevices.LineLeader.setKIfactor (   self)

Write the Ki factor value to the Lineleader.

Parameters
selfThe object pointer.
def MsDevices.LineLeader.setKP (   self)

Write the Kp value to the Lineleader.

Parameters
selfThe object pointer.
def MsDevices.LineLeader.setKPfactor (   self)

Write the Kp factor value to the Lineleader.

Parameters
selfThe object pointer.
def MsDevices.LineLeader.setSetPoint (   self)

Writes the Setpoint register.

Parameters
selfThe object pointer.
def MsDevices.LineLeader.Sleep (   self)

Puts to sleep, or turns off the LEDs of the LineLeader.

Parameters
selfThe object pointer.
def MsDevices.LineLeader.steering (   self)

Read the steering value from the Lineleader (add or subtract this value to the motor speed)

Parameters
selfThe object pointer.
def MsDevices.LineLeader.Wakeup (   self)

Wakes up or turns on the LEDs of the LineLeader.

Parameters
selfThe object pointer.
def MsDevices.LineLeader.White_Cal (   self)

Calibrates the white value for the LineLeader.

Parameters
selfThe object pointer.

Member Data Documentation

int MsDevices.LineLeader.LL_AVERAGE = 0x43
static

Average Register.

Will return a byte value

int MsDevices.LineLeader.LL_RESULT = 0x44
static

Steering Register.

Will return a byte value

int MsDevices.LineLeader.LL_STEERING = 0x42
static

Steering Register.

Will return a signed byte value


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