Motoron Motor Controller library for Raspberry Pi
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
motoron.MotoronI2C Class Reference
Inheritance diagram for motoron.MotoronI2C:
motoron.MotoronBase

Public Member Functions

def __init__ (self, *bus=1, address=16)
 
def set_bus (self, bus)
 
def __init__ (self, *bus=1, address=16)
 
def set_bus (self, bus)
 

Public Attributes

 address
 
 bus
 

Protected Member Functions

def _smbus_send_command_core (self, cmd, send_crc)
 
def _smbus_read_response (self, length)
 
def _mpy_send_command_core (self, cmd, send_crc)
 
def _mpy_read_response (self, length)
 
def _smbus_send_command_core (self, cmd, send_crc)
 
def _smbus_read_response (self, length)
 
def _mpy_send_command_core (self, cmd, send_crc)
 
def _mpy_read_response (self, length)
 

Protected Attributes

 _send_command_core
 
 _read_response
 
 _msg
 

Detailed Description

Represents an I2C connection to a Pololu Motoron Motor Controller.

Definition at line 1665 of file motoron.py.

Constructor & Destructor Documentation

◆ __init__() [1/2]

def motoron.MotoronI2C.__init__ (   self,
bus = 1,
  address = 16 
)

Creates a new MotoronI2C object to communicate with the Motoron over I2C.

Parameters
busOptional argument that specifies which I2C bus to use. This can be an integer, an SMBus object from the smbus2 package, or an object with an interface similar to SMBus. The default bus is 1, which corresponds to /dev/i2c-1.
addressOptional argument that specifies the 7-bit I2C address to use. This must match the address that the Motoron is configured to use. The default address is 16.

Reimplemented from motoron.MotoronBase.

Definition at line 1670 of file motoron.py.

◆ __init__() [2/2]

def motoron.MotoronI2C.__init__ (   self,
bus = 1,
  address = 16 
)

Creates a new MotoronI2C object to communicate with the Motoron over I2C.

Parameters
busOptional argument that specifies which I2C bus to use. This can be an integer, an SMBus object from the smbus2 package, or an object with an interface similar to SMBus. The default bus is 1, which corresponds to /dev/i2c-1.
addressOptional argument that specifies the 7-bit I2C address to use. This must match the address that the Motoron is configured to use. The default address is 16.

Reimplemented from motoron.MotoronBase.

Definition at line 1670 of file motoron.py.

Member Function Documentation

◆ _mpy_read_response() [1/2]

def motoron.MotoronI2C._mpy_read_response (   self,
  length 
)
protected

Definition at line 1750 of file motoron.py.

◆ _mpy_read_response() [2/2]

def motoron.MotoronI2C._mpy_read_response (   self,
  length 
)
protected

Definition at line 1750 of file motoron.py.

◆ _mpy_send_command_core() [1/2]

def motoron.MotoronI2C._mpy_send_command_core (   self,
  cmd,
  send_crc 
)
protected

Definition at line 1744 of file motoron.py.

◆ _mpy_send_command_core() [2/2]

def motoron.MotoronI2C._mpy_send_command_core (   self,
  cmd,
  send_crc 
)
protected

Definition at line 1744 of file motoron.py.

◆ _smbus_read_response() [1/2]

def motoron.MotoronI2C._smbus_read_response (   self,
  length 
)
protected

Definition at line 1727 of file motoron.py.

◆ _smbus_read_response() [2/2]

def motoron.MotoronI2C._smbus_read_response (   self,
  length 
)
protected

Definition at line 1727 of file motoron.py.

◆ _smbus_send_command_core() [1/2]

def motoron.MotoronI2C._smbus_send_command_core (   self,
  cmd,
  send_crc 
)
protected

Definition at line 1720 of file motoron.py.

◆ _smbus_send_command_core() [2/2]

def motoron.MotoronI2C._smbus_send_command_core (   self,
  cmd,
  send_crc 
)
protected

Definition at line 1720 of file motoron.py.

◆ set_bus() [1/2]

def motoron.MotoronI2C.set_bus (   self,
  bus 
)

Definition at line 1698 of file motoron.py.

◆ set_bus() [2/2]

def motoron.MotoronI2C.set_bus (   self,
  bus 
)

Definition at line 1698 of file motoron.py.

Member Data Documentation

◆ _msg

motoron.MotoronI2C._msg
protected

Definition at line 1713 of file motoron.py.

◆ _read_response

motoron.MotoronI2C._read_response
protected

Definition at line 1711 of file motoron.py.

◆ _send_command_core

motoron.MotoronI2C._send_command_core
protected

Definition at line 1710 of file motoron.py.

◆ address

motoron.MotoronI2C.address

The 7-bit I2C address used by this object.

The default is 16.

Definition at line 1687 of file motoron.py.

◆ bus

motoron.MotoronI2C.bus

Definition at line 1718 of file motoron.py.


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