Motoron Motor Controller library for Raspberry Pi
|
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) |
Variables | |
motoron.try : | |
object | motoron.Enum = object |
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.
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().
milliamps | The desired current limit, in units of mA. |
type | Specifies what type of Motoron you are using. This should be one of the members of the motoron.CurrentSenseType enum. |
reference_mv | The reference voltage (IOREF), in millivolts. For example, use 3300 for a 3.3 V system or 5000 for a 5 V system. |
offset | The 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.
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.
type | Specifies what type of Motoron you are using. This should be one of the members of the motoron.CurrentSenseType enum. |
reference_mv | The 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.
def motoron.enum_value | ( | x | ) |
Definition at line 10 of file motoron.py.
object motoron.Enum = object |
Definition at line 12 of file motoron.py.
motoron.try : |
Definition at line 8 of file motoron.py.