Motoron Motor Controller library for Raspberry Pi
Loading...
Searching...
No Matches
Classes | Functions
motoron.py File Reference

Go to the source code of this file.

Classes

class  motoron.CurrentSenseType
 
class  motoron.VinSenseType
 
class  motoron.MotoronBase
 
class  motoron.MotoronI2C
 
class  motoron.MotoronSerial
 

Functions

def motoron.enum_value (x)
 
def motoron.calculate_current_limit (milliamps, type, reference_mv, offset)
 
def motoron.current_sense_units_milliamps (type, reference_mv)
 

Detailed Description

This is the main file for the Motoron Motor Controller Python library for Raspberry Pi.

For more information about the library, see the main repository at: https://github.com/pololu/motoron-python

Definition in file motoron.py.

Function Documentation

◆ calculate_current_limit()

def motoron.calculate_current_limit (   milliamps,
  type,
  reference_mv,
  offset 
)

Calculates a current limit value that can be passed to the Motoron using set_current_limit().

Parameters
milliampsThe desired current limit, in units of mA.
typeSpecifies what type of Motoron you are using. This should be one of the members of the motoron.CurrentSenseType enum.
reference_mvThe reference voltage (IOREF), in millivolts. For example, use 3300 for a 3.3 V system or 5000 for a 5 V system.
offsetThe offset of the raw current sense signal for the Motoron channel. This is the same measurement that you would put into the Motoron's "Current sense offset" variable using set_current_sense_offset(), so see the documentation of that function for more info. The offset is typically 10 for 5 V systems and 15 for 3.3 V systems, (50*1024/reference_mv) but it can vary widely.

Definition at line 1628 of file motoron.py.

◆ current_sense_units_milliamps()

def motoron.current_sense_units_milliamps (   type,
  reference_mv 
)

Calculates the units for the Motoron's current sense reading returned by get_current_sense_processed(), in milliamps.

To convert a reading from get_current_sense_processed() to milliamps multiply it by the value returned from this function.

Parameters
typeSpecifies what type of Motoron you are using. This should be one of the members of the motoron.CurrentSenseType enum.
reference_mvThe reference voltage (IOREF), in millivolts. For example, use 3300 for a 3.3 V system or 5000 for a 5 V system.

Definition at line 1650 of file motoron.py.

◆ enum_value()

def motoron.enum_value (   x)

Definition at line 10 of file motoron.py.