Motoron Motor Controller library for Raspberry Pi
Loading...
Searching...
No Matches
motoron.MotoronI2C Class Reference
Inheritance diagram for motoron.MotoronI2C:
motoron.MotoronBase motoron.MotoronBase

Public Member Functions

 __init__ (self, *, bus=1, address=16)
 set_bus (self, bus)
 __init__ (self, *, bus=1, address=16)
 set_bus (self, bus)
 get_firmware_version (self)
 get_firmware_version (self)
 set_protocol_options (self, options)
 set_protocol_options (self, options)
 set_protocol_options_locally (self, options)
 set_protocol_options_locally (self, options)
 enable_crc (self)
 enable_crc (self)
 disable_crc (self)
 disable_crc (self)
 enable_crc_for_commands (self)
 enable_crc_for_commands (self)
 disable_crc_for_commands (self)
 disable_crc_for_commands (self)
 enable_crc_for_responses (self)
 enable_crc_for_responses (self)
 disable_crc_for_responses (self)
 disable_crc_for_responses (self)
 enable_i2c_general_call (self)
 enable_i2c_general_call (self)
 disable_i2c_general_call (self)
 disable_i2c_general_call (self)
 read_eeprom (self, offset, length)
 read_eeprom (self, offset, length)
 read_eeprom_device_number (self)
 read_eeprom_device_number (self)
 write_eeprom (self, offset, value)
 write_eeprom (self, offset, value)
 write_eeprom16 (self, offset, value)
 write_eeprom16 (self, offset, value)
 write_eeprom_device_number (self, number)
 write_eeprom_device_number (self, number)
 write_eeprom_alternative_device_number (self, number)
 write_eeprom_alternative_device_number (self, number)
 write_eeprom_disable_alternative_device_number (self)
 write_eeprom_disable_alternative_device_number (self)
 write_eeprom_communication_options (self, options)
 write_eeprom_communication_options (self, options)
 write_eeprom_baud_rate (self, baud)
 write_eeprom_baud_rate (self, baud)
 write_eeprom_response_delay (self, delay)
 write_eeprom_response_delay (self, delay)
 reinitialize (self)
 reinitialize (self)
 reset (self, ignore_nack=True)
 reset (self, ignore_nack=True)
 get_variables (self, motor, offset, length)
 get_variables (self, motor, offset, length)
 get_var_u8 (self, motor, offset)
 get_var_u8 (self, motor, offset)
 get_var_u16 (self, motor, offset)
 get_var_u16 (self, motor, offset)
 get_var_s16 (self, motor, offset)
 get_var_s16 (self, motor, offset)
 get_status_flags (self)
 get_status_flags (self)
 get_protocol_error_flag (self)
 get_protocol_error_flag (self)
 get_crc_error_flag (self)
 get_crc_error_flag (self)
 get_command_timeout_latched_flag (self)
 get_command_timeout_latched_flag (self)
 get_motor_fault_latched_flag (self)
 get_motor_fault_latched_flag (self)
 get_no_power_latched_flag (self)
 get_no_power_latched_flag (self)
 get_reset_flag (self)
 get_reset_flag (self)
 get_motor_faulting_flag (self)
 get_motor_faulting_flag (self)
 get_no_power_flag (self)
 get_no_power_flag (self)
 get_error_active_flag (self)
 get_error_active_flag (self)
 get_motor_output_enabled_flag (self)
 get_motor_output_enabled_flag (self)
 get_motor_driving_flag (self)
 get_motor_driving_flag (self)
 get_vin_voltage (self)
 get_vin_voltage (self)
 get_vin_voltage_mv (self, reference_mv=3300, type=VinSenseType.MOTORON_256)
 get_vin_voltage_mv (self, reference_mv=3300, type=VinSenseType.MOTORON_256)
 get_command_timeout_milliseconds (self)
 get_command_timeout_milliseconds (self)
 get_error_response (self)
 get_error_response (self)
 get_error_mask (self)
 get_error_mask (self)
 get_jumper_state (self)
 get_jumper_state (self)
 get_target_speed (self, motor)
 get_target_speed (self, motor)
 get_target_brake_amount (self, motor)
 get_target_brake_amount (self, motor)
 get_current_speed (self, motor)
 get_current_speed (self, motor)
 get_buffered_speed (self, motor)
 get_buffered_speed (self, motor)
 get_pwm_mode (self, motor)
 get_pwm_mode (self, motor)
 get_max_acceleration_forward (self, motor)
 get_max_acceleration_forward (self, motor)
 get_max_acceleration_reverse (self, motor)
 get_max_acceleration_reverse (self, motor)
 get_max_deceleration_forward (self, motor)
 get_max_deceleration_forward (self, motor)
 get_max_deceleration_reverse (self, motor)
 get_max_deceleration_reverse (self, motor)
 get_starting_speed_forward (self, motor)
 get_starting_speed_forward (self, motor)
 get_starting_speed_reverse (self, motor)
 get_starting_speed_reverse (self, motor)
 get_direction_change_delay_forward (self, motor)
 get_direction_change_delay_forward (self, motor)
 get_direction_change_delay_reverse (self, motor)
 get_direction_change_delay_reverse (self, motor)
 get_current_limit (self, motor)
 get_current_limit (self, motor)
 get_current_sense_reading (self, motor)
 get_current_sense_reading (self, motor)
 get_current_sense_raw_and_speed (self, motor)
 get_current_sense_raw_and_speed (self, motor)
 get_current_sense_processed_and_speed (self, motor)
 get_current_sense_processed_and_speed (self, motor)
 get_current_sense_raw (self, motor)
 get_current_sense_raw (self, motor)
 get_current_sense_processed (self, motor)
 get_current_sense_processed (self, motor)
 get_current_sense_offset (self, motor)
 get_current_sense_offset (self, motor)
 get_current_sense_minimum_divisor (self, motor)
 get_current_sense_minimum_divisor (self, motor)
 set_variable (self, motor, offset, value)
 set_variable (self, motor, offset, value)
 set_command_timeout_milliseconds (self, ms)
 set_command_timeout_milliseconds (self, ms)
 set_error_response (self, response)
 set_error_response (self, response)
 set_error_mask (self, mask)
 set_error_mask (self, mask)
 disable_command_timeout (self)
 disable_command_timeout (self)
 set_pwm_mode (self, motor, mode)
 set_pwm_mode (self, motor, mode)
 set_max_acceleration_forward (self, motor, accel)
 set_max_acceleration_forward (self, motor, accel)
 set_max_acceleration_reverse (self, motor, accel)
 set_max_acceleration_reverse (self, motor, accel)
 set_max_acceleration (self, motor, accel)
 set_max_acceleration (self, motor, accel)
 set_max_deceleration_forward (self, motor, decel)
 set_max_deceleration_forward (self, motor, decel)
 set_max_deceleration_reverse (self, motor, decel)
 set_max_deceleration_reverse (self, motor, decel)
 set_max_deceleration (self, motor, decel)
 set_max_deceleration (self, motor, decel)
 set_starting_speed_forward (self, motor, speed)
 set_starting_speed_forward (self, motor, speed)
 set_starting_speed_reverse (self, motor, speed)
 set_starting_speed_reverse (self, motor, speed)
 set_starting_speed (self, motor, speed)
 set_starting_speed (self, motor, speed)
 set_direction_change_delay_forward (self, motor, duration)
 set_direction_change_delay_forward (self, motor, duration)
 set_direction_change_delay_reverse (self, motor, duration)
 set_direction_change_delay_reverse (self, motor, duration)
 set_direction_change_delay (self, motor, duration)
 set_direction_change_delay (self, motor, duration)
 set_current_limit (self, motor, limit)
 set_current_limit (self, motor, limit)
 set_current_sense_offset (self, motor, offset)
 set_current_sense_offset (self, motor, offset)
 set_current_sense_minimum_divisor (self, motor, speed)
 set_current_sense_minimum_divisor (self, motor, speed)
 coast_now (self)
 coast_now (self)
 clear_motor_fault (self, flags=0)
 clear_motor_fault (self, flags=0)
 clear_motor_fault_unconditional (self)
 clear_motor_fault_unconditional (self)
 clear_latched_status_flags (self, flags)
 clear_latched_status_flags (self, flags)
 clear_reset_flag (self)
 clear_reset_flag (self)
 set_latched_status_flags (self, flags)
 set_latched_status_flags (self, flags)
 set_speed (self, motor, speed)
 set_speed (self, motor, speed)
 set_speed_now (self, motor, speed)
 set_speed_now (self, motor, speed)
 set_buffered_speed (self, motor, speed)
 set_buffered_speed (self, motor, speed)
 set_all_speeds (self, *speeds)
 set_all_speeds (self, *speeds)
 set_all_speeds_now (self, *speeds)
 set_all_speeds_now (self, *speeds)
 set_all_buffered_speeds (self, *speeds)
 set_all_buffered_speeds (self, *speeds)
 set_all_speeds_using_buffers (self)
 set_all_speeds_using_buffers (self)
 set_all_speeds_now_using_buffers (self)
 set_all_speeds_now_using_buffers (self)
 set_braking (self, motor, amount)
 set_braking (self, motor, amount)
 set_braking_now (self, motor, amount)
 set_braking_now (self, motor, amount)
 reset_command_timeout (self)
 reset_command_timeout (self)

Public Attributes

 address = address
 bus = bus
tuple protocol_options = MotoronBase.__DEFAULT_PROTOCOL_OPTIONS

Static Public Attributes

tuple DEFAULT_ERROR_MASK

Protected Member Functions

 _smbus_send_command_core (self, cmd, send_crc)
 _smbus_read_response (self, length)
 _mpy_send_command_core (self, cmd, send_crc)
 _mpy_read_response (self, length)
 _smbus_send_command_core (self, cmd, send_crc)
 _smbus_read_response (self, length)
 _mpy_send_command_core (self, cmd, send_crc)
 _mpy_read_response (self, length)
 _send_command (self, cmd)
 _send_command (self, cmd)
 _send_command_and_read_response (self, cmd, response_length)
 _send_command_and_read_response (self, cmd, response_length)

Protected Attributes

 _send_command_core = self._smbus_send_command_core
 _read_response = self._smbus_read_response
 _msg = smbus2.i2c_msg

Detailed Description

Represents an I2C connection to a Pololu Motoron Motor Controller.

Definition at line 1669 of file motoron.py.

Constructor & Destructor Documentation

◆ __init__() [1/2]

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.

Definition at line 1674 of file motoron.py.

◆ __init__() [2/2]

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.

Definition at line 1674 of file motoron.py.

Member Function Documentation

◆ _mpy_read_response() [1/2]

motoron.MotoronI2C._mpy_read_response ( self,
length )
protected

Definition at line 1754 of file motoron.py.

◆ _mpy_read_response() [2/2]

motoron.MotoronI2C._mpy_read_response ( self,
length )
protected

Definition at line 1754 of file motoron.py.

◆ _mpy_send_command_core() [1/2]

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

Definition at line 1748 of file motoron.py.

◆ _mpy_send_command_core() [2/2]

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

Definition at line 1748 of file motoron.py.

◆ _send_command() [1/2]

motoron.MotoronBase._send_command ( self,
cmd )
protectedinherited

Definition at line 1621 of file motoron.py.

◆ _send_command() [2/2]

motoron.MotoronBase._send_command ( self,
cmd )
protectedinherited

Definition at line 1621 of file motoron.py.

◆ _send_command_and_read_response() [1/2]

motoron.MotoronBase._send_command_and_read_response ( self,
cmd,
response_length )
protectedinherited

Definition at line 1625 of file motoron.py.

◆ _send_command_and_read_response() [2/2]

motoron.MotoronBase._send_command_and_read_response ( self,
cmd,
response_length )
protectedinherited

Definition at line 1625 of file motoron.py.

◆ _smbus_read_response() [1/2]

motoron.MotoronI2C._smbus_read_response ( self,
length )
protected

Definition at line 1731 of file motoron.py.

◆ _smbus_read_response() [2/2]

motoron.MotoronI2C._smbus_read_response ( self,
length )
protected

Definition at line 1731 of file motoron.py.

◆ _smbus_send_command_core() [1/2]

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

Definition at line 1724 of file motoron.py.

◆ _smbus_send_command_core() [2/2]

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

Definition at line 1724 of file motoron.py.

◆ clear_latched_status_flags() [1/2]

motoron.MotoronBase.clear_latched_status_flags ( self,
flags )
inherited

Clears the specified flags in get_status_flags().

For each bit in the flags argument that is 1, this command clears the corresponding bit in the "Status flags" variable, setting it to 0.

For more information, see the "Clear latched status flags" command in the Motoron user's guide.

See also
get_status_flags(), set_latched_status_flags()

Definition at line 1310 of file motoron.py.

◆ clear_latched_status_flags() [2/2]

motoron.MotoronBase.clear_latched_status_flags ( self,
flags )
inherited

Clears the specified flags in get_status_flags().

For each bit in the flags argument that is 1, this command clears the corresponding bit in the "Status flags" variable, setting it to 0.

For more information, see the "Clear latched status flags" command in the Motoron user's guide.

See also
get_status_flags(), set_latched_status_flags()

Definition at line 1310 of file motoron.py.

◆ clear_motor_fault() [1/2]

motoron.MotoronBase.clear_motor_fault ( self,
flags = 0 )
inherited

Sends a "Clear motor fault" command to the Motoron.

If any of the Motoron's motors chips are currently experiencing a fault (error), or bit 0 of the flags argument is 1, this command makes the Motoron attempt to recover from the faults.

For more information, see the "Clear motor fault" command in the Motoron user's guide.

See also
clear_motor_fault_unconditional(), get_motor_faulting_flag()

Definition at line 1284 of file motoron.py.

◆ clear_motor_fault() [2/2]

motoron.MotoronBase.clear_motor_fault ( self,
flags = 0 )
inherited

Sends a "Clear motor fault" command to the Motoron.

If any of the Motoron's motors chips are currently experiencing a fault (error), or bit 0 of the flags argument is 1, this command makes the Motoron attempt to recover from the faults.

For more information, see the "Clear motor fault" command in the Motoron user's guide.

See also
clear_motor_fault_unconditional(), get_motor_faulting_flag()

Definition at line 1284 of file motoron.py.

◆ clear_motor_fault_unconditional() [1/2]

motoron.MotoronBase.clear_motor_fault_unconditional ( self)
inherited

Sends a "Clear motor fault" command to the Motoron with the "unconditional" flag set, so the Motoron will attempt to recover from any motor faults even if no fault is currently occurring.

This is a more robust version of clear_motor_fault().

Definition at line 1300 of file motoron.py.

◆ clear_motor_fault_unconditional() [2/2]

motoron.MotoronBase.clear_motor_fault_unconditional ( self)
inherited

Sends a "Clear motor fault" command to the Motoron with the "unconditional" flag set, so the Motoron will attempt to recover from any motor faults even if no fault is currently occurring.

This is a more robust version of clear_motor_fault().

Definition at line 1300 of file motoron.py.

◆ clear_reset_flag() [1/2]

motoron.MotoronBase.clear_reset_flag ( self)
inherited

Clears the Motoron's reset flag.

The reset flag is a latched status flag in get_status_flags() that is particularly important to clear: it gets set to 1 after the Motoron powers on or experiences a reset, and it is considered to be an error by default, so it prevents the motors from running. Therefore, it is necessary to call this function (or clear_latched_status_flags()) to clear the Reset flag before you can get the motors running.

We recommend that immediately after you clear the reset flag. you should configure the Motoron's motor settings and error response settings. That way, if the Motoron experiences an unexpected reset while your system is running, it will stop running its motors and it will not start them again until all the important settings have been configured.

See also
clear_latched_status_flags()

Definition at line 1329 of file motoron.py.

◆ clear_reset_flag() [2/2]

motoron.MotoronBase.clear_reset_flag ( self)
inherited

Clears the Motoron's reset flag.

The reset flag is a latched status flag in get_status_flags() that is particularly important to clear: it gets set to 1 after the Motoron powers on or experiences a reset, and it is considered to be an error by default, so it prevents the motors from running. Therefore, it is necessary to call this function (or clear_latched_status_flags()) to clear the Reset flag before you can get the motors running.

We recommend that immediately after you clear the reset flag. you should configure the Motoron's motor settings and error response settings. That way, if the Motoron experiences an unexpected reset while your system is running, it will stop running its motors and it will not start them again until all the important settings have been configured.

See also
clear_latched_status_flags()

Definition at line 1329 of file motoron.py.

◆ coast_now() [1/2]

motoron.MotoronBase.coast_now ( self)
inherited

Sends a "Coast now" command to the Motoron, causing all of the motors to immediately start coasting.

For more information, see the "Coast now" command in the Motoron user's guide.

Definition at line 1273 of file motoron.py.

◆ coast_now() [2/2]

motoron.MotoronBase.coast_now ( self)
inherited

Sends a "Coast now" command to the Motoron, causing all of the motors to immediately start coasting.

For more information, see the "Coast now" command in the Motoron user's guide.

Definition at line 1273 of file motoron.py.

◆ disable_command_timeout() [1/2]

motoron.MotoronBase.disable_command_timeout ( self)
inherited

This disables the Motoron's command timeout feature by resetting the the "Error mask" variable to its default value but with the command timeout bit cleared.

By default, the Motoron's command timeout will occur if no valid commands are received in 1500 milliseconds, and the command timeout is treated as an error, so the motors will shut down. You can use this function if you want to disable that feature.

Note that this function overrides any previous values you set in the "Error mask" variable, so if you are using set_error_mask() in your program to configure which status flags are treated as errors, you do not need to use this function and you probably should not use this function.

See also
set_command_timeout_milliseconds(), set_error_mask()

Definition at line 1033 of file motoron.py.

◆ disable_command_timeout() [2/2]

motoron.MotoronBase.disable_command_timeout ( self)
inherited

This disables the Motoron's command timeout feature by resetting the the "Error mask" variable to its default value but with the command timeout bit cleared.

By default, the Motoron's command timeout will occur if no valid commands are received in 1500 milliseconds, and the command timeout is treated as an error, so the motors will shut down. You can use this function if you want to disable that feature.

Note that this function overrides any previous values you set in the "Error mask" variable, so if you are using set_error_mask() in your program to configure which status flags are treated as errors, you do not need to use this function and you probably should not use this function.

See also
set_command_timeout_milliseconds(), set_error_mask()

Definition at line 1033 of file motoron.py.

◆ disable_crc() [1/2]

motoron.MotoronBase.disable_crc ( self)
inherited

Disables CRC for commands and responses.

See set_protocol_options().

Definition at line 149 of file motoron.py.

◆ disable_crc() [2/2]

motoron.MotoronBase.disable_crc ( self)
inherited

Disables CRC for commands and responses.

See set_protocol_options().

Definition at line 149 of file motoron.py.

◆ disable_crc_for_commands() [1/2]

motoron.MotoronBase.disable_crc_for_commands ( self)
inherited

Disables CRC for commands.

See set_protocol_options().

Definition at line 164 of file motoron.py.

◆ disable_crc_for_commands() [2/2]

motoron.MotoronBase.disable_crc_for_commands ( self)
inherited

Disables CRC for commands.

See set_protocol_options().

Definition at line 164 of file motoron.py.

◆ disable_crc_for_responses() [1/2]

motoron.MotoronBase.disable_crc_for_responses ( self)
inherited

Disables CRC for responses.

See set_protocol_options().

Definition at line 178 of file motoron.py.

◆ disable_crc_for_responses() [2/2]

motoron.MotoronBase.disable_crc_for_responses ( self)
inherited

Disables CRC for responses.

See set_protocol_options().

Definition at line 178 of file motoron.py.

◆ disable_i2c_general_call() [1/2]

motoron.MotoronBase.disable_i2c_general_call ( self)
inherited

Disables the I2C general call address.

See set_protocol_options().

Definition at line 192 of file motoron.py.

◆ disable_i2c_general_call() [2/2]

motoron.MotoronBase.disable_i2c_general_call ( self)
inherited

Disables the I2C general call address.

See set_protocol_options().

Definition at line 192 of file motoron.py.

◆ enable_crc() [1/2]

motoron.MotoronBase.enable_crc ( self)
inherited

Enables CRC for commands and responses.

See set_protocol_options().

Definition at line 141 of file motoron.py.

◆ enable_crc() [2/2]

motoron.MotoronBase.enable_crc ( self)
inherited

Enables CRC for commands and responses.

See set_protocol_options().

Definition at line 141 of file motoron.py.

◆ enable_crc_for_commands() [1/2]

motoron.MotoronBase.enable_crc_for_commands ( self)
inherited

Enables CRC for commands.

See set_protocol_options().

Definition at line 157 of file motoron.py.

◆ enable_crc_for_commands() [2/2]

motoron.MotoronBase.enable_crc_for_commands ( self)
inherited

Enables CRC for commands.

See set_protocol_options().

Definition at line 157 of file motoron.py.

◆ enable_crc_for_responses() [1/2]

motoron.MotoronBase.enable_crc_for_responses ( self)
inherited

Enables CRC for responses.

See set_protocol_options().

Definition at line 171 of file motoron.py.

◆ enable_crc_for_responses() [2/2]

motoron.MotoronBase.enable_crc_for_responses ( self)
inherited

Enables CRC for responses.

See set_protocol_options().

Definition at line 171 of file motoron.py.

◆ enable_i2c_general_call() [1/2]

motoron.MotoronBase.enable_i2c_general_call ( self)
inherited

Enables the I2C general call address.

See set_protocol_options().

Definition at line 185 of file motoron.py.

◆ enable_i2c_general_call() [2/2]

motoron.MotoronBase.enable_i2c_general_call ( self)
inherited

Enables the I2C general call address.

See set_protocol_options().

Definition at line 185 of file motoron.py.

◆ get_buffered_speed() [1/2]

motoron.MotoronBase.get_buffered_speed ( self,
motor )
inherited

Reads the buffered speed of the specified motor.

For more information, see the "Buffered speed" variable in the Motoron user's guide.

See also
set_buffered_speed(), set_all_buffered_speeds()

Definition at line 720 of file motoron.py.

◆ get_buffered_speed() [2/2]

motoron.MotoronBase.get_buffered_speed ( self,
motor )
inherited

Reads the buffered speed of the specified motor.

For more information, see the "Buffered speed" variable in the Motoron user's guide.

See also
set_buffered_speed(), set_all_buffered_speeds()

Definition at line 720 of file motoron.py.

◆ get_command_timeout_latched_flag() [1/2]

motoron.MotoronBase.get_command_timeout_latched_flag ( self)
inherited

Returns the "Command timeout latched" bit from get_status_flags().

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 525 of file motoron.py.

◆ get_command_timeout_latched_flag() [2/2]

motoron.MotoronBase.get_command_timeout_latched_flag ( self)
inherited

Returns the "Command timeout latched" bit from get_status_flags().

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 525 of file motoron.py.

◆ get_command_timeout_milliseconds() [1/2]

motoron.MotoronBase.get_command_timeout_milliseconds ( self)
inherited

Reads the "Command timeout" variable and converts it to milliseconds.

For more information, see the "Command timeout" variable in the Motoron user's guide.

See also
set_command_timeout_milliseconds()

Definition at line 641 of file motoron.py.

◆ get_command_timeout_milliseconds() [2/2]

motoron.MotoronBase.get_command_timeout_milliseconds ( self)
inherited

Reads the "Command timeout" variable and converts it to milliseconds.

For more information, see the "Command timeout" variable in the Motoron user's guide.

See also
set_command_timeout_milliseconds()

Definition at line 641 of file motoron.py.

◆ get_crc_error_flag() [1/2]

motoron.MotoronBase.get_crc_error_flag ( self)
inherited

Returns the "CRC error" bit from get_status_flags().

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 516 of file motoron.py.

◆ get_crc_error_flag() [2/2]

motoron.MotoronBase.get_crc_error_flag ( self)
inherited

Returns the "CRC error" bit from get_status_flags().

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 516 of file motoron.py.

◆ get_current_limit() [1/2]

motoron.MotoronBase.get_current_limit ( self,
motor )
inherited

Reads the current limit for the specified motor.

This only works for the high-power Motorons.

For more information, see the "Current limit" variable in the Motoron user's guide.

See also
set_current_limit()

Definition at line 845 of file motoron.py.

◆ get_current_limit() [2/2]

motoron.MotoronBase.get_current_limit ( self,
motor )
inherited

Reads the current limit for the specified motor.

This only works for the high-power Motorons.

For more information, see the "Current limit" variable in the Motoron user's guide.

See also
set_current_limit()

Definition at line 845 of file motoron.py.

◆ get_current_sense_minimum_divisor() [1/2]

motoron.MotoronBase.get_current_sense_minimum_divisor ( self,
motor )
inherited

Reads the current sense minimum divisor setting and returns it as a speed between 0 and 800.

This only works for the high-power Motorons.

For more information, see the "Current sense minimum divisor" variable in the Motoron user's guide.

See also
set_current_sense_minimum_divisor()

Definition at line 948 of file motoron.py.

◆ get_current_sense_minimum_divisor() [2/2]

motoron.MotoronBase.get_current_sense_minimum_divisor ( self,
motor )
inherited

Reads the current sense minimum divisor setting and returns it as a speed between 0 and 800.

This only works for the high-power Motorons.

For more information, see the "Current sense minimum divisor" variable in the Motoron user's guide.

See also
set_current_sense_minimum_divisor()

Definition at line 948 of file motoron.py.

◆ get_current_sense_offset() [1/2]

motoron.MotoronBase.get_current_sense_offset ( self,
motor )
inherited

Reads the current sense offset setting.

This only works for the high-power Motorons.

For more information, see the "Current sense offset" variable in the Motoron user's guide.

See also
set_current_sense_offset()

Definition at line 935 of file motoron.py.

◆ get_current_sense_offset() [2/2]

motoron.MotoronBase.get_current_sense_offset ( self,
motor )
inherited

Reads the current sense offset setting.

This only works for the high-power Motorons.

For more information, see the "Current sense offset" variable in the Motoron user's guide.

See also
set_current_sense_offset()

Definition at line 935 of file motoron.py.

◆ get_current_sense_processed() [1/2]

motoron.MotoronBase.get_current_sense_processed ( self,
motor )
inherited

Reads the processed current sense reading for the specified motor.

This only works for the Motorons with current sensing.

The units of this reading depend on the logic voltage of the Motoron and on the specific model of Motoron that you have, and you can use current_sense_units_milliamps() to calculate the units.

For the high-power Motorons, the accuracy of this reading can be improved by measuring the current sense offset and setting it with set_current_sense_offset(). See the "Current sense processed" variable in the Motoron user's guide for or the current_sense_calibrate example for more information.

Note that this reading will be 0xFFFF if an overflow happens during the calculation due to very high current.

See also
get_current_sense_processed_and_speed()

Definition at line 912 of file motoron.py.

◆ get_current_sense_processed() [2/2]

motoron.MotoronBase.get_current_sense_processed ( self,
motor )
inherited

Reads the processed current sense reading for the specified motor.

This only works for the Motorons with current sensing.

The units of this reading depend on the logic voltage of the Motoron and on the specific model of Motoron that you have, and you can use current_sense_units_milliamps() to calculate the units.

For the high-power Motorons, the accuracy of this reading can be improved by measuring the current sense offset and setting it with set_current_sense_offset(). See the "Current sense processed" variable in the Motoron user's guide for or the current_sense_calibrate example for more information.

Note that this reading will be 0xFFFF if an overflow happens during the calculation due to very high current.

See also
get_current_sense_processed_and_speed()

Definition at line 912 of file motoron.py.

◆ get_current_sense_processed_and_speed() [1/2]

motoron.MotoronBase.get_current_sense_processed_and_speed ( self,
motor )
inherited

This is like get_current_sense_reading() but it only reads the processed current sense measurement and the speed.

This only works for the Motorons with current sensing.

Definition at line 887 of file motoron.py.

◆ get_current_sense_processed_and_speed() [2/2]

motoron.MotoronBase.get_current_sense_processed_and_speed ( self,
motor )
inherited

This is like get_current_sense_reading() but it only reads the processed current sense measurement and the speed.

This only works for the Motorons with current sensing.

Definition at line 887 of file motoron.py.

◆ get_current_sense_raw() [1/2]

motoron.MotoronBase.get_current_sense_raw ( self,
motor )
inherited

Reads the raw current sense measurement for the specified motor.

This only works for the Motorons with current sensing.

For more information, see the "Current sense raw" variable in the Motoron user's guide.

See also
get_current_sense_reading()

Definition at line 898 of file motoron.py.

◆ get_current_sense_raw() [2/2]

motoron.MotoronBase.get_current_sense_raw ( self,
motor )
inherited

Reads the raw current sense measurement for the specified motor.

This only works for the Motorons with current sensing.

For more information, see the "Current sense raw" variable in the Motoron user's guide.

See also
get_current_sense_reading()

Definition at line 898 of file motoron.py.

◆ get_current_sense_raw_and_speed() [1/2]

motoron.MotoronBase.get_current_sense_raw_and_speed ( self,
motor )
inherited

This is like get_current_sense_reading() but it only reads the raw current sense measurement and the speed.

This only works for the Motorons with current sensing.

Definition at line 876 of file motoron.py.

◆ get_current_sense_raw_and_speed() [2/2]

motoron.MotoronBase.get_current_sense_raw_and_speed ( self,
motor )
inherited

This is like get_current_sense_reading() but it only reads the raw current sense measurement and the speed.

This only works for the Motorons with current sensing.

Definition at line 876 of file motoron.py.

◆ get_current_sense_reading() [1/2]

motoron.MotoronBase.get_current_sense_reading ( self,
motor )
inherited

Reads all the results from the last current sense measurement for the specified motor.

This function reads the "Current sense raw", "Current sense speed", and "Current sense processed" variables from the Motoron using a single command, so the values returned are all guaranteed to be part of the same measurement.

This only works for the Motorons with current sensing.

See also
get_current_sense_raw_and_speed(), get_current_sense_processed_and_speed()

Definition at line 858 of file motoron.py.

◆ get_current_sense_reading() [2/2]

motoron.MotoronBase.get_current_sense_reading ( self,
motor )
inherited

Reads all the results from the last current sense measurement for the specified motor.

This function reads the "Current sense raw", "Current sense speed", and "Current sense processed" variables from the Motoron using a single command, so the values returned are all guaranteed to be part of the same measurement.

This only works for the Motorons with current sensing.

See also
get_current_sense_raw_and_speed(), get_current_sense_processed_and_speed()

Definition at line 858 of file motoron.py.

◆ get_current_speed() [1/2]

motoron.MotoronBase.get_current_speed ( self,
motor )
inherited

Reads the current speed of the specified motor, which is the speed that the Motoron is currently trying to apply to the motor.

For more information, see the "Target speed" variable in the Motoron user's guide.

See also
set_speed_now(), set_all_speeds_now(), set_all_speeds_now_using_buffers()

Definition at line 708 of file motoron.py.

◆ get_current_speed() [2/2]

motoron.MotoronBase.get_current_speed ( self,
motor )
inherited

Reads the current speed of the specified motor, which is the speed that the Motoron is currently trying to apply to the motor.

For more information, see the "Target speed" variable in the Motoron user's guide.

See also
set_speed_now(), set_all_speeds_now(), set_all_speeds_now_using_buffers()

Definition at line 708 of file motoron.py.

◆ get_direction_change_delay_forward() [1/2]

motoron.MotoronBase.get_direction_change_delay_forward ( self,
motor )
inherited

Reads the direction change delay for the specified motor in the forward direction.

For more information, see the "Direction change delay forward" variable in the Motoron user's guide.

See also
set_direction_change_delay(), set_direction_change_delay_forward()

Definition at line 821 of file motoron.py.

◆ get_direction_change_delay_forward() [2/2]

motoron.MotoronBase.get_direction_change_delay_forward ( self,
motor )
inherited

Reads the direction change delay for the specified motor in the forward direction.

For more information, see the "Direction change delay forward" variable in the Motoron user's guide.

See also
set_direction_change_delay(), set_direction_change_delay_forward()

Definition at line 821 of file motoron.py.

◆ get_direction_change_delay_reverse() [1/2]

motoron.MotoronBase.get_direction_change_delay_reverse ( self,
motor )
inherited

Reads the direction change delay for the specified motor in the reverse direction.

For more information, see the "Direction change delay reverse" variable in the Motoron user's guide.

See also
set_direction_change_delay(), set_direction_change_delay_reverse()

Definition at line 833 of file motoron.py.

◆ get_direction_change_delay_reverse() [2/2]

motoron.MotoronBase.get_direction_change_delay_reverse ( self,
motor )
inherited

Reads the direction change delay for the specified motor in the reverse direction.

For more information, see the "Direction change delay reverse" variable in the Motoron user's guide.

See also
set_direction_change_delay(), set_direction_change_delay_reverse()

Definition at line 833 of file motoron.py.

◆ get_error_active_flag() [1/2]

motoron.MotoronBase.get_error_active_flag ( self)
inherited

Returns the "Error active" bit from get_status_flags().

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 586 of file motoron.py.

◆ get_error_active_flag() [2/2]

motoron.MotoronBase.get_error_active_flag ( self)
inherited

Returns the "Error active" bit from get_status_flags().

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 586 of file motoron.py.

◆ get_error_mask() [1/2]

motoron.MotoronBase.get_error_mask ( self)
inherited

Reads the "Error mask" variable, which defines which status flags are considered to be errors.

For more information, see the "Error mask" variable in the Motoron user's guide.

See also
set_error_mask()

Definition at line 664 of file motoron.py.

◆ get_error_mask() [2/2]

motoron.MotoronBase.get_error_mask ( self)
inherited

Reads the "Error mask" variable, which defines which status flags are considered to be errors.

For more information, see the "Error mask" variable in the Motoron user's guide.

See also
set_error_mask()

Definition at line 664 of file motoron.py.

◆ get_error_response() [1/2]

motoron.MotoronBase.get_error_response ( self)
inherited

Reads the "Error response" variable, which defines how the Motoron will stop its motors when an error is happening.

For more information, see the "Error response" variable in the Motoron user's guide.

See also
set_error_response()

Definition at line 652 of file motoron.py.

◆ get_error_response() [2/2]

motoron.MotoronBase.get_error_response ( self)
inherited

Reads the "Error response" variable, which defines how the Motoron will stop its motors when an error is happening.

For more information, see the "Error response" variable in the Motoron user's guide.

See also
set_error_response()

Definition at line 652 of file motoron.py.

◆ get_firmware_version() [1/2]

motoron.MotoronBase.get_firmware_version ( self)
inherited

Sends the "Get firmware version" command to get the device's firmware product ID and firmware version numbers.

For more information, see the "Get firmware version" command in the Motoron user's guide.

Returns
A dictionary in this format:
{'product_id': 204, 'firmware_version': {'major': 1, 'minor': 0}}

Definition at line 58 of file motoron.py.

◆ get_firmware_version() [2/2]

motoron.MotoronBase.get_firmware_version ( self)
inherited

Sends the "Get firmware version" command to get the device's firmware product ID and firmware version numbers.

For more information, see the "Get firmware version" command in the Motoron user's guide.

Returns
A dictionary in this format:
{'product_id': 204, 'firmware_version': {'major': 1, 'minor': 0}}

Definition at line 58 of file motoron.py.

◆ get_jumper_state() [1/2]

motoron.MotoronBase.get_jumper_state ( self)
inherited

Reads the "Jumper state" variable.

For more information, see the "Jumper state" variable in the Motoron user's guide

Definition at line 676 of file motoron.py.

◆ get_jumper_state() [2/2]

motoron.MotoronBase.get_jumper_state ( self)
inherited

Reads the "Jumper state" variable.

For more information, see the "Jumper state" variable in the Motoron user's guide

Definition at line 676 of file motoron.py.

◆ get_max_acceleration_forward() [1/2]

motoron.MotoronBase.get_max_acceleration_forward ( self,
motor )
inherited

Reads the maximum acceleration of the specified motor for the forward direction.

For more information, see the "Max acceleration forward" variable in the Motoron user's guide.

See also
set_max_acceleration(), set_max_acceleration_forward()

Definition at line 742 of file motoron.py.

◆ get_max_acceleration_forward() [2/2]

motoron.MotoronBase.get_max_acceleration_forward ( self,
motor )
inherited

Reads the maximum acceleration of the specified motor for the forward direction.

For more information, see the "Max acceleration forward" variable in the Motoron user's guide.

See also
set_max_acceleration(), set_max_acceleration_forward()

Definition at line 742 of file motoron.py.

◆ get_max_acceleration_reverse() [1/2]

motoron.MotoronBase.get_max_acceleration_reverse ( self,
motor )
inherited

Reads the maximum acceleration of the specified motor for the reverse direction.

For more information, see the "Max acceleration reverse" variable in the Motoron user's guide.

See also
set_max_acceleration(), set_max_acceleration_reverse()

Definition at line 754 of file motoron.py.

◆ get_max_acceleration_reverse() [2/2]

motoron.MotoronBase.get_max_acceleration_reverse ( self,
motor )
inherited

Reads the maximum acceleration of the specified motor for the reverse direction.

For more information, see the "Max acceleration reverse" variable in the Motoron user's guide.

See also
set_max_acceleration(), set_max_acceleration_reverse()

Definition at line 754 of file motoron.py.

◆ get_max_deceleration_forward() [1/2]

motoron.MotoronBase.get_max_deceleration_forward ( self,
motor )
inherited

Reads the maximum deceleration of the specified motor for the forward direction.

For more information, see the "Max deceleration forward" variable in the Motoron user's guide.

See also
set_max_deceleration(), set_max_deceleration_forward()

Definition at line 766 of file motoron.py.

◆ get_max_deceleration_forward() [2/2]

motoron.MotoronBase.get_max_deceleration_forward ( self,
motor )
inherited

Reads the maximum deceleration of the specified motor for the forward direction.

For more information, see the "Max deceleration forward" variable in the Motoron user's guide.

See also
set_max_deceleration(), set_max_deceleration_forward()

Definition at line 766 of file motoron.py.

◆ get_max_deceleration_reverse() [1/2]

motoron.MotoronBase.get_max_deceleration_reverse ( self,
motor )
inherited

Reads the maximum deceleration of the specified motor for the reverse direction.

For more information, see the "Max deceleration reverse" variable in the Motoron user's guide.

See also
set_max_deceleration(), set_max_deceleration_reverse()

Definition at line 778 of file motoron.py.

◆ get_max_deceleration_reverse() [2/2]

motoron.MotoronBase.get_max_deceleration_reverse ( self,
motor )
inherited

Reads the maximum deceleration of the specified motor for the reverse direction.

For more information, see the "Max deceleration reverse" variable in the Motoron user's guide.

See also
set_max_deceleration(), set_max_deceleration_reverse()

Definition at line 778 of file motoron.py.

◆ get_motor_driving_flag() [1/2]

motoron.MotoronBase.get_motor_driving_flag ( self)
inherited

Returns the "Motor driving" bit from get_status_flags().

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 604 of file motoron.py.

◆ get_motor_driving_flag() [2/2]

motoron.MotoronBase.get_motor_driving_flag ( self)
inherited

Returns the "Motor driving" bit from get_status_flags().

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 604 of file motoron.py.

◆ get_motor_fault_latched_flag() [1/2]

motoron.MotoronBase.get_motor_fault_latched_flag ( self)
inherited

Returns the "Motor fault latched" bit from get_status_flags().

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 534 of file motoron.py.

◆ get_motor_fault_latched_flag() [2/2]

motoron.MotoronBase.get_motor_fault_latched_flag ( self)
inherited

Returns the "Motor fault latched" bit from get_status_flags().

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 534 of file motoron.py.

◆ get_motor_faulting_flag() [1/2]

motoron.MotoronBase.get_motor_faulting_flag ( self)
inherited

Returns the "Motor faulting" bit from get_status_flags().

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 568 of file motoron.py.

◆ get_motor_faulting_flag() [2/2]

motoron.MotoronBase.get_motor_faulting_flag ( self)
inherited

Returns the "Motor faulting" bit from get_status_flags().

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 568 of file motoron.py.

◆ get_motor_output_enabled_flag() [1/2]

motoron.MotoronBase.get_motor_output_enabled_flag ( self)
inherited

Returns the "Motor output enabled" bit from get_status_flags().

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 595 of file motoron.py.

◆ get_motor_output_enabled_flag() [2/2]

motoron.MotoronBase.get_motor_output_enabled_flag ( self)
inherited

Returns the "Motor output enabled" bit from get_status_flags().

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 595 of file motoron.py.

◆ get_no_power_flag() [1/2]

motoron.MotoronBase.get_no_power_flag ( self)
inherited

Returns the "No power" bit from get_status_flags().

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 577 of file motoron.py.

◆ get_no_power_flag() [2/2]

motoron.MotoronBase.get_no_power_flag ( self)
inherited

Returns the "No power" bit from get_status_flags().

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 577 of file motoron.py.

◆ get_no_power_latched_flag() [1/2]

motoron.MotoronBase.get_no_power_latched_flag ( self)
inherited

Returns the "No power latched" bit from get_status_flags().

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 543 of file motoron.py.

◆ get_no_power_latched_flag() [2/2]

motoron.MotoronBase.get_no_power_latched_flag ( self)
inherited

Returns the "No power latched" bit from get_status_flags().

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 543 of file motoron.py.

◆ get_protocol_error_flag() [1/2]

motoron.MotoronBase.get_protocol_error_flag ( self)
inherited

Returns the "Protocol error" bit from get_status_flags().

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 507 of file motoron.py.

◆ get_protocol_error_flag() [2/2]

motoron.MotoronBase.get_protocol_error_flag ( self)
inherited

Returns the "Protocol error" bit from get_status_flags().

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 507 of file motoron.py.

◆ get_pwm_mode() [1/2]

motoron.MotoronBase.get_pwm_mode ( self,
motor )
inherited

Reads the PWM mode of the specified motor.

For more information, see the "PWM mode" variable in the Motoron user's guide.

See also
set_pwm_mode()

Definition at line 731 of file motoron.py.

◆ get_pwm_mode() [2/2]

motoron.MotoronBase.get_pwm_mode ( self,
motor )
inherited

Reads the PWM mode of the specified motor.

For more information, see the "PWM mode" variable in the Motoron user's guide.

See also
set_pwm_mode()

Definition at line 731 of file motoron.py.

◆ get_reset_flag() [1/2]

motoron.MotoronBase.get_reset_flag ( self)
inherited

Returns the "Reset" bit from get_status_flags().

This bit is set to 1 when the Motoron powers on, its processor is reset (e.g. by reset()), or it receives a reinitialize() command. It can be cleared using clear_reset_flag() or clear_latched_status_flags().

By default, the Motoron is configured to treat this bit as an error, so you will need to clear it before you can turn on the motors.

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 552 of file motoron.py.

◆ get_reset_flag() [2/2]

motoron.MotoronBase.get_reset_flag ( self)
inherited

Returns the "Reset" bit from get_status_flags().

This bit is set to 1 when the Motoron powers on, its processor is reset (e.g. by reset()), or it receives a reinitialize() command. It can be cleared using clear_reset_flag() or clear_latched_status_flags().

By default, the Motoron is configured to treat this bit as an error, so you will need to clear it before you can turn on the motors.

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 552 of file motoron.py.

◆ get_starting_speed_forward() [1/2]

motoron.MotoronBase.get_starting_speed_forward ( self,
motor )
inherited

Reads the starting speed for the specified motor in the forward direction.

For more information, see the "Starting speed forward" variable in the Motoron user's guide.

See also
set_starting_speed(), set_starting_speed_forward()

Definition at line 799 of file motoron.py.

◆ get_starting_speed_forward() [2/2]

motoron.MotoronBase.get_starting_speed_forward ( self,
motor )
inherited

Reads the starting speed for the specified motor in the forward direction.

For more information, see the "Starting speed forward" variable in the Motoron user's guide.

See also
set_starting_speed(), set_starting_speed_forward()

Definition at line 799 of file motoron.py.

◆ get_starting_speed_reverse() [1/2]

motoron.MotoronBase.get_starting_speed_reverse ( self,
motor )
inherited

Reads the starting speed for the specified motor in the reverse direction.

For more information, see the "Starting speed reverse" variable in the Motoron user's guide.

See also
set_starting_speed(), set_starting_speed_reverse()

Definition at line 810 of file motoron.py.

◆ get_starting_speed_reverse() [2/2]

motoron.MotoronBase.get_starting_speed_reverse ( self,
motor )
inherited

Reads the starting speed for the specified motor in the reverse direction.

For more information, see the "Starting speed reverse" variable in the Motoron user's guide.

See also
set_starting_speed(), set_starting_speed_reverse()

Definition at line 810 of file motoron.py.

◆ get_status_flags() [1/2]

motoron.MotoronBase.get_status_flags ( self)
inherited

Reads the "Status flags" variable from the Motoron.

The bits in this variable are defined by the STATUS_FLAGS_* constants in the motoron package:

  • motoron.STATUS_FLAG_PROTOCOL_ERROR
  • motoron.STATUS_FLAG_CRC_ERROR
  • motoron.STATUS_FLAG_COMMAND_TIMEOUT_LATCHED
  • motoron.STATUS_FLAG_MOTOR_FAULT_LATCHED
  • motoron.STATUS_FLAG_NO_POWER_LATCHED
  • motoron.STATUS_FLAG_RESET
  • motoron.STATUS_FLAG_COMMAND_TIMEOUT
  • motoron.STATUS_FLAG_MOTOR_FAULTING
  • motoron.STATUS_FLAG_NO_POWER
  • motoron.STATUS_FLAG_ERROR_ACTIVE
  • motoron.STATUS_FLAG_MOTOR_OUTPUT_ENABLED
  • motoron.STATUS_FLAG_MOTOR_DRIVING

Here is some example code that uses bitwise operators to check whether there is currently a motor fault or a lack of power:

mask = ((1 << motoron.STATUS_FLAG_NO_POWER) |
(1 << motoron.STATUS_FLAG_MOTOR_FAULTING))
if mc.get_status_flags() & mask: # do something

This library has helper methods that make it easier if you just want to read a single bit:

The clear_latched_status_flags() method sets the specified set of latched status flags to 0. The reinitialize() and reset() commands reset the latched status flags to their default values.

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 454 of file motoron.py.

◆ get_status_flags() [2/2]

motoron.MotoronBase.get_status_flags ( self)
inherited

Reads the "Status flags" variable from the Motoron.

The bits in this variable are defined by the STATUS_FLAGS_* constants in the motoron package:

  • motoron.STATUS_FLAG_PROTOCOL_ERROR
  • motoron.STATUS_FLAG_CRC_ERROR
  • motoron.STATUS_FLAG_COMMAND_TIMEOUT_LATCHED
  • motoron.STATUS_FLAG_MOTOR_FAULT_LATCHED
  • motoron.STATUS_FLAG_NO_POWER_LATCHED
  • motoron.STATUS_FLAG_RESET
  • motoron.STATUS_FLAG_COMMAND_TIMEOUT
  • motoron.STATUS_FLAG_MOTOR_FAULTING
  • motoron.STATUS_FLAG_NO_POWER
  • motoron.STATUS_FLAG_ERROR_ACTIVE
  • motoron.STATUS_FLAG_MOTOR_OUTPUT_ENABLED
  • motoron.STATUS_FLAG_MOTOR_DRIVING

Here is some example code that uses bitwise operators to check whether there is currently a motor fault or a lack of power:

mask = ((1 << motoron.STATUS_FLAG_NO_POWER) |
(1 << motoron.STATUS_FLAG_MOTOR_FAULTING))
if mc.get_status_flags() & mask: # do something

This library has helper methods that make it easier if you just want to read a single bit:

The clear_latched_status_flags() method sets the specified set of latched status flags to 0. The reinitialize() and reset() commands reset the latched status flags to their default values.

For more information, see the "Status flags" variable in the Motoron user's guide.

Definition at line 454 of file motoron.py.

◆ get_target_brake_amount() [1/2]

motoron.MotoronBase.get_target_brake_amount ( self,
motor )
inherited

Reads the target brake amount for the specified motor.

For more information, see the "Target speed" variable in the Motoron user's guide.

See also
set_target_brake_amount()

Definition at line 697 of file motoron.py.

◆ get_target_brake_amount() [2/2]

motoron.MotoronBase.get_target_brake_amount ( self,
motor )
inherited

Reads the target brake amount for the specified motor.

For more information, see the "Target speed" variable in the Motoron user's guide.

See also
set_target_brake_amount()

Definition at line 697 of file motoron.py.

◆ get_target_speed() [1/2]

motoron.MotoronBase.get_target_speed ( self,
motor )
inherited

Reads the target speed of the specified motor, which is the speed at which the motor has been commanded to move.

For more information, see the "Target speed" variable in the Motoron user's guide.

See also
set_speed(), set_all_speeds(), set_all_speeds_using_buffers()

Definition at line 685 of file motoron.py.

◆ get_target_speed() [2/2]

motoron.MotoronBase.get_target_speed ( self,
motor )
inherited

Reads the target speed of the specified motor, which is the speed at which the motor has been commanded to move.

For more information, see the "Target speed" variable in the Motoron user's guide.

See also
set_speed(), set_all_speeds(), set_all_speeds_using_buffers()

Definition at line 685 of file motoron.py.

◆ get_var_s16() [1/2]

motoron.MotoronBase.get_var_s16 ( self,
motor,
offset )
inherited

Reads two bytes from the Motoron using a "Get variables" command and returns the result as a signed 16-bit integer.

Parameters
motor0 to read general variables, or a motor number to read motor-specific variables.
offsetThe location of the first byte to read.

Definition at line 442 of file motoron.py.

◆ get_var_s16() [2/2]

motoron.MotoronBase.get_var_s16 ( self,
motor,
offset )
inherited

Reads two bytes from the Motoron using a "Get variables" command and returns the result as a signed 16-bit integer.

Parameters
motor0 to read general variables, or a motor number to read motor-specific variables.
offsetThe location of the first byte to read.

Definition at line 442 of file motoron.py.

◆ get_var_u16() [1/2]

motoron.MotoronBase.get_var_u16 ( self,
motor,
offset )
inherited

Reads two bytes from the Motoron using a "Get variables" command and returns the result as an unsigned 16-bit integer.

Parameters
motor0 to read general variables, or a motor number to read motor-specific variables.
offsetThe location of the first byte to read.

Definition at line 430 of file motoron.py.

◆ get_var_u16() [2/2]

motoron.MotoronBase.get_var_u16 ( self,
motor,
offset )
inherited

Reads two bytes from the Motoron using a "Get variables" command and returns the result as an unsigned 16-bit integer.

Parameters
motor0 to read general variables, or a motor number to read motor-specific variables.
offsetThe location of the first byte to read.

Definition at line 430 of file motoron.py.

◆ get_var_u8() [1/2]

motoron.MotoronBase.get_var_u8 ( self,
motor,
offset )
inherited

Reads one byte from the Motoron using a "Get variables" command and returns the result as an unsigned 8-bit integer.

Parameters
motor0 to read a general variable, or a motor number to read a motor-specific variable.
offsetThe location of the byte to read.

Definition at line 419 of file motoron.py.

◆ get_var_u8() [2/2]

motoron.MotoronBase.get_var_u8 ( self,
motor,
offset )
inherited

Reads one byte from the Motoron using a "Get variables" command and returns the result as an unsigned 8-bit integer.

Parameters
motor0 to read a general variable, or a motor number to read a motor-specific variable.
offsetThe location of the byte to read.

Definition at line 419 of file motoron.py.

◆ get_variables() [1/2]

motoron.MotoronBase.get_variables ( self,
motor,
offset,
length )
inherited

Reads information from the Motoron using a "Get variables" command.

This library has helper methods to read every variable, but this method is useful if you want to get the raw bytes, or if you want to read multiple consecutive variables at the same time for efficiency.

Parameters
motor0 to read general variables, or a motor number to read motor-specific variables.
offsetThe location of the first byte to read.
lengthHow many bytes to read.

Definition at line 398 of file motoron.py.

◆ get_variables() [2/2]

motoron.MotoronBase.get_variables ( self,
motor,
offset,
length )
inherited

Reads information from the Motoron using a "Get variables" command.

This library has helper methods to read every variable, but this method is useful if you want to get the raw bytes, or if you want to read multiple consecutive variables at the same time for efficiency.

Parameters
motor0 to read general variables, or a motor number to read motor-specific variables.
offsetThe location of the first byte to read.
lengthHow many bytes to read.

Definition at line 398 of file motoron.py.

◆ get_vin_voltage() [1/2]

motoron.MotoronBase.get_vin_voltage ( self)
inherited

Reads voltage on the Motoron's VIN pin, in raw device units.

For more information, see the "VIN voltage" variable in the Motoron user's guide.

See also
get_vin_voltage_mv()

Definition at line 613 of file motoron.py.

◆ get_vin_voltage() [2/2]

motoron.MotoronBase.get_vin_voltage ( self)
inherited

Reads voltage on the Motoron's VIN pin, in raw device units.

For more information, see the "VIN voltage" variable in the Motoron user's guide.

See also
get_vin_voltage_mv()

Definition at line 613 of file motoron.py.

◆ get_vin_voltage_mv() [1/2]

motoron.MotoronBase.get_vin_voltage_mv ( self,
reference_mv = 3300,
type = VinSenseType.MOTORON_256 )
inherited

Reads the voltage on the Motoron's VIN pin and converts it to millivolts.

For more information, see the "VIN voltage" variable in the Motoron user's guide.

Parameters
reference_mvThe logic voltage of the Motoron, in millivolts. This is assumed to be 3300 by default.
typeSpecifies what type of Motoron you are using. This should be one of the members of the motoron.VinSenseType enum.
See also
get_vin_voltage()

Definition at line 624 of file motoron.py.

◆ get_vin_voltage_mv() [2/2]

motoron.MotoronBase.get_vin_voltage_mv ( self,
reference_mv = 3300,
type = VinSenseType.MOTORON_256 )
inherited

Reads the voltage on the Motoron's VIN pin and converts it to millivolts.

For more information, see the "VIN voltage" variable in the Motoron user's guide.

Parameters
reference_mvThe logic voltage of the Motoron, in millivolts. This is assumed to be 3300 by default.
typeSpecifies what type of Motoron you are using. This should be one of the members of the motoron.VinSenseType enum.
See also
get_vin_voltage()

Definition at line 624 of file motoron.py.

◆ read_eeprom() [1/2]

motoron.MotoronBase.read_eeprom ( self,
offset,
length )
inherited

Reads the specified bytes from the Motoron's EEPROM memory.

For more information, see the "Read EEPROM" command in the Motoron user's guide.

Definition at line 199 of file motoron.py.

◆ read_eeprom() [2/2]

motoron.MotoronBase.read_eeprom ( self,
offset,
length )
inherited

Reads the specified bytes from the Motoron's EEPROM memory.

For more information, see the "Read EEPROM" command in the Motoron user's guide.

Definition at line 199 of file motoron.py.

◆ read_eeprom_device_number() [1/2]

motoron.MotoronBase.read_eeprom_device_number ( self)
inherited

Reads the EEPROM device number from the device.

This is the I2C address that the device uses if it detects that JMP1 is shorted to GND when it starts up. It is stored in non-volatile EEPROM memory.

Definition at line 213 of file motoron.py.

◆ read_eeprom_device_number() [2/2]

motoron.MotoronBase.read_eeprom_device_number ( self)
inherited

Reads the EEPROM device number from the device.

This is the I2C address that the device uses if it detects that JMP1 is shorted to GND when it starts up. It is stored in non-volatile EEPROM memory.

Definition at line 213 of file motoron.py.

◆ reinitialize() [1/2]

motoron.MotoronBase.reinitialize ( self)
inherited

Sends a "Reinitialize" command to the Motoron, which resets most of the Motoron's variables to their default state.

For more information, see the "Reinitialize" command in the Motoron user's guide.

See also
reset()

Definition at line 353 of file motoron.py.

◆ reinitialize() [2/2]

motoron.MotoronBase.reinitialize ( self)
inherited

Sends a "Reinitialize" command to the Motoron, which resets most of the Motoron's variables to their default state.

For more information, see the "Reinitialize" command in the Motoron user's guide.

See also
reset()

Definition at line 353 of file motoron.py.

◆ reset() [1/2]

motoron.MotoronBase.reset ( self,
ignore_nack = True )
inherited

Sends a "Reset" command to the Motoron, which does a full hardware reset.

This command is equivalent to briefly driving the Motoron's RST pin low. The Motoron's RST is briefly driven low by the Motoron itself as a result of this command.

After running this command, we recommend waiting for at least 5 milliseconds before you try to communicate with the Motoron.

Parameters
ignore_nackOptional argument: if True (the default), this method ignores a NACK error if it occurs on sending the Reset command. This is useful in case the Motoron has CRC off and executes the reset before it can ACK the CRC byte (which this method always sends to make it more reliable).
See also
reinitialize()

Definition at line 368 of file motoron.py.

◆ reset() [2/2]

motoron.MotoronBase.reset ( self,
ignore_nack = True )
inherited

Sends a "Reset" command to the Motoron, which does a full hardware reset.

This command is equivalent to briefly driving the Motoron's RST pin low. The Motoron's RST is briefly driven low by the Motoron itself as a result of this command.

After running this command, we recommend waiting for at least 5 milliseconds before you try to communicate with the Motoron.

Parameters
ignore_nackOptional argument: if True (the default), this method ignores a NACK error if it occurs on sending the Reset command. This is useful in case the Motoron has CRC off and executes the reset before it can ACK the CRC byte (which this method always sends to make it more reliable).
See also
reinitialize()

Definition at line 368 of file motoron.py.

◆ reset_command_timeout() [1/2]

motoron.MotoronBase.reset_command_timeout ( self)
inherited

Resets the command timeout.

This prevents the command timeout status flags from getting set for some time. (The command timeout is also reset by every other Motoron command, as long as its parameters are valid.)

For more information, see the "Reset command timeout" command in the Motoron user's guide.

See also
disable_command_timeout(), set_command_timeout_milliseconds()

Definition at line 1605 of file motoron.py.

◆ reset_command_timeout() [2/2]

motoron.MotoronBase.reset_command_timeout ( self)
inherited

Resets the command timeout.

This prevents the command timeout status flags from getting set for some time. (The command timeout is also reset by every other Motoron command, as long as its parameters are valid.)

For more information, see the "Reset command timeout" command in the Motoron user's guide.

See also
disable_command_timeout(), set_command_timeout_milliseconds()

Definition at line 1605 of file motoron.py.

◆ set_all_buffered_speeds() [1/2]

motoron.MotoronBase.set_all_buffered_speeds ( self,
* speeds )
inherited

Sets the buffered speeds of all the motors.

The number of speed arguments you provide to this function must be equal to the number of motor channels your Motoron has, or else this command might not work.

This command does not immediately cause any change to the motors: it stores speeds for each motor in the Motoron so they can be used by later commands.

For more information, see the "Set all speeds" command in the Motoron user's guide.

See also
set_speed(), set_buffered_speed(), set_all_speeds(), set_all_speeds_using_buffers(), set_all_speeds_now_using_buffers()

Definition at line 1495 of file motoron.py.

◆ set_all_buffered_speeds() [2/2]

motoron.MotoronBase.set_all_buffered_speeds ( self,
* speeds )
inherited

Sets the buffered speeds of all the motors.

The number of speed arguments you provide to this function must be equal to the number of motor channels your Motoron has, or else this command might not work.

This command does not immediately cause any change to the motors: it stores speeds for each motor in the Motoron so they can be used by later commands.

For more information, see the "Set all speeds" command in the Motoron user's guide.

See also
set_speed(), set_buffered_speed(), set_all_speeds(), set_all_speeds_using_buffers(), set_all_speeds_now_using_buffers()

Definition at line 1495 of file motoron.py.

◆ set_all_speeds() [1/2]

motoron.MotoronBase.set_all_speeds ( self,
* speeds )
inherited

Sets the target speeds of all the motors at the same time.

The number of speed arguments you provide to this function must be equal to the number of motor channels your Motoron has, or else this command might not work.

This is equivalent to calling set_speed() once for each motor, but it is more efficient because all of the speeds are sent in the same command.

There are a few different ways you can call this method (and the related methods that set speeds for all the motors):

# with separate arguments
mc.set_all_speeds(100, -200, 300)
# with arguments unpacked from a list
speeds = [-400, 500, -600]
mc.set_all_speeds(*speeds)

For more information, see the "Set all speeds" command in the Motoron user's guide.

See also
set_speed(), set_all_speeds_now(), set_all_buffered_speeds()

Definition at line 1435 of file motoron.py.

◆ set_all_speeds() [2/2]

motoron.MotoronBase.set_all_speeds ( self,
* speeds )
inherited

Sets the target speeds of all the motors at the same time.

The number of speed arguments you provide to this function must be equal to the number of motor channels your Motoron has, or else this command might not work.

This is equivalent to calling set_speed() once for each motor, but it is more efficient because all of the speeds are sent in the same command.

There are a few different ways you can call this method (and the related methods that set speeds for all the motors):

# with separate arguments
mc.set_all_speeds(100, -200, 300)
# with arguments unpacked from a list
speeds = [-400, 500, -600]
mc.set_all_speeds(*speeds)

For more information, see the "Set all speeds" command in the Motoron user's guide.

See also
set_speed(), set_all_speeds_now(), set_all_buffered_speeds()

Definition at line 1435 of file motoron.py.

◆ set_all_speeds_now() [1/2]

motoron.MotoronBase.set_all_speeds_now ( self,
* speeds )
inherited

Sets the target and current speeds of all the motors at the same time.

The number of speed arguments you provide to this function must be equal to the number of motor channels your Motoron has, or else this command might not work.

This is equivalent to calling set_speed_now() once for each motor, but it is more efficient because all of the speeds are sent in the same command.

For more information, see the "Set all speeds" command in the Motoron user's guide.

See also
set_speed(), set_speed_now(), set_all_speeds()

Definition at line 1471 of file motoron.py.

◆ set_all_speeds_now() [2/2]

motoron.MotoronBase.set_all_speeds_now ( self,
* speeds )
inherited

Sets the target and current speeds of all the motors at the same time.

The number of speed arguments you provide to this function must be equal to the number of motor channels your Motoron has, or else this command might not work.

This is equivalent to calling set_speed_now() once for each motor, but it is more efficient because all of the speeds are sent in the same command.

For more information, see the "Set all speeds" command in the Motoron user's guide.

See also
set_speed(), set_speed_now(), set_all_speeds()

Definition at line 1471 of file motoron.py.

◆ set_all_speeds_now_using_buffers() [1/2]

motoron.MotoronBase.set_all_speeds_now_using_buffers ( self)
inherited

Sets each motor's target speed and current speed equal to the buffered speed.

This command is the same as set_all_speeds_now() except that the speeds are provided ahead of time using set_buffered_speed() or set_all_buffered_speeds().

See also
set_all_speeds_using_buffers(), set_buffered_speed(), set_all_buffered_speeds()

Definition at line 1534 of file motoron.py.

◆ set_all_speeds_now_using_buffers() [2/2]

motoron.MotoronBase.set_all_speeds_now_using_buffers ( self)
inherited

Sets each motor's target speed and current speed equal to the buffered speed.

This command is the same as set_all_speeds_now() except that the speeds are provided ahead of time using set_buffered_speed() or set_all_buffered_speeds().

See also
set_all_speeds_using_buffers(), set_buffered_speed(), set_all_buffered_speeds()

Definition at line 1534 of file motoron.py.

◆ set_all_speeds_using_buffers() [1/2]

motoron.MotoronBase.set_all_speeds_using_buffers ( self)
inherited

Sets each motor's target speed equal to the buffered speed.

This command is the same as set_all_speeds() except that the speeds are provided ahead of time using set_buffered_speed() or set_all_buffered_speeds().

See also
set_all_speeds_now_using_buffers(), set_buffered_speed(), set_all_buffered_speeds()

Definition at line 1521 of file motoron.py.

◆ set_all_speeds_using_buffers() [2/2]

motoron.MotoronBase.set_all_speeds_using_buffers ( self)
inherited

Sets each motor's target speed equal to the buffered speed.

This command is the same as set_all_speeds() except that the speeds are provided ahead of time using set_buffered_speed() or set_all_buffered_speeds().

See also
set_all_speeds_now_using_buffers(), set_buffered_speed(), set_all_buffered_speeds()

Definition at line 1521 of file motoron.py.

◆ set_braking() [1/2]

motoron.MotoronBase.set_braking ( self,
motor,
amount )
inherited

Commands the motor to brake, coast, or something in between.

Sending this command causes the motor to decelerate to speed 0 obeying any relevant deceleration limits. Once the current speed reaches 0, the motor will attempt to brake or coast as specified by this command, but due to hardware limitations it might not be able to.

The motor number parameter should be between 1 and the number of motors supported by the Motoron.

The amount parameter gets stored in the "Target brake amount" variable for the motor and should be between 0 (coasting) and 800 (braking). Values above 800 will be clipped to 800 by the Motoron firmware.

See the "Set braking" command in the Motoron user's guide for more information.

See also
set_braking_now(), get_target_brake_amount()

Definition at line 1548 of file motoron.py.

◆ set_braking() [2/2]

motoron.MotoronBase.set_braking ( self,
motor,
amount )
inherited

Commands the motor to brake, coast, or something in between.

Sending this command causes the motor to decelerate to speed 0 obeying any relevant deceleration limits. Once the current speed reaches 0, the motor will attempt to brake or coast as specified by this command, but due to hardware limitations it might not be able to.

The motor number parameter should be between 1 and the number of motors supported by the Motoron.

The amount parameter gets stored in the "Target brake amount" variable for the motor and should be between 0 (coasting) and 800 (braking). Values above 800 will be clipped to 800 by the Motoron firmware.

See the "Set braking" command in the Motoron user's guide for more information.

See also
set_braking_now(), get_target_brake_amount()

Definition at line 1548 of file motoron.py.

◆ set_braking_now() [1/2]

motoron.MotoronBase.set_braking_now ( self,
motor,
amount )
inherited

Commands the motor to brake, coast, or something in between.

Sending this command causes the motor's current speed to change to 0. The motor will attempt to brake or coast as specified by this command, but due to hardware limitations it might not be able to.

The motor number parameter should be between 1 and the number of motors supported by the Motoron.

The amount parameter gets stored in the "Target brake amount" variable for the motor and should be between 0 (coasting) and 800 (braking). Values above 800 will be clipped to 800 by the Motoron firmware.

See the "Set braking" command in the Motoron user's guide for more information.

See also
set_braking(), get_target_brake_amount()

Definition at line 1577 of file motoron.py.

◆ set_braking_now() [2/2]

motoron.MotoronBase.set_braking_now ( self,
motor,
amount )
inherited

Commands the motor to brake, coast, or something in between.

Sending this command causes the motor's current speed to change to 0. The motor will attempt to brake or coast as specified by this command, but due to hardware limitations it might not be able to.

The motor number parameter should be between 1 and the number of motors supported by the Motoron.

The amount parameter gets stored in the "Target brake amount" variable for the motor and should be between 0 (coasting) and 800 (braking). Values above 800 will be clipped to 800 by the Motoron firmware.

See the "Set braking" command in the Motoron user's guide for more information.

See also
set_braking(), get_target_brake_amount()

Definition at line 1577 of file motoron.py.

◆ set_buffered_speed() [1/2]

motoron.MotoronBase.set_buffered_speed ( self,
motor,
speed )
inherited

Sets the buffered speed of the specified motor.

This command does not immediately cause any change to the motor: it stores a speed for the specified motor in the Motoron so it can be used by later commands.

For more information, see the "Set speed" command in the Motoron user's guide.

See also
set_speed(), set_all_buffered_speeds(), set_all_speeds_using_buffers(), set_all_speeds_now_using_buffers()

Definition at line 1413 of file motoron.py.

◆ set_buffered_speed() [2/2]

motoron.MotoronBase.set_buffered_speed ( self,
motor,
speed )
inherited

Sets the buffered speed of the specified motor.

This command does not immediately cause any change to the motor: it stores a speed for the specified motor in the Motoron so it can be used by later commands.

For more information, see the "Set speed" command in the Motoron user's guide.

See also
set_speed(), set_all_buffered_speeds(), set_all_speeds_using_buffers(), set_all_speeds_now_using_buffers()

Definition at line 1413 of file motoron.py.

◆ set_bus() [1/2]

motoron.MotoronI2C.set_bus ( self,
bus )

Definition at line 1702 of file motoron.py.

◆ set_bus() [2/2]

motoron.MotoronI2C.set_bus ( self,
bus )

Definition at line 1702 of file motoron.py.

◆ set_command_timeout_milliseconds() [1/2]

motoron.MotoronBase.set_command_timeout_milliseconds ( self,
ms )
inherited

Sets the command timeout period, in milliseconds.

For more information, see the "Command timeout" variable in the Motoron user's guide.

See also
disable_command_timeout(), get_command_timeout_milliseconds()

Definition at line 988 of file motoron.py.

◆ set_command_timeout_milliseconds() [2/2]

motoron.MotoronBase.set_command_timeout_milliseconds ( self,
ms )
inherited

Sets the command timeout period, in milliseconds.

For more information, see the "Command timeout" variable in the Motoron user's guide.

See also
disable_command_timeout(), get_command_timeout_milliseconds()

Definition at line 988 of file motoron.py.

◆ set_current_limit() [1/2]

motoron.MotoronBase.set_current_limit ( self,
motor,
limit )
inherited

Sets the current limit for the specified motor.

This only works for the high-power Motorons.

The units of the current limit depend on the type of Motoron you have and the logic voltage of your system. See the "Current limit" variable in the Motoron user's guide for more information, or see calculate_current_limit().

See also
get_current_limit()

Definition at line 1214 of file motoron.py.

◆ set_current_limit() [2/2]

motoron.MotoronBase.set_current_limit ( self,
motor,
limit )
inherited

Sets the current limit for the specified motor.

This only works for the high-power Motorons.

The units of the current limit depend on the type of Motoron you have and the logic voltage of your system. See the "Current limit" variable in the Motoron user's guide for more information, or see calculate_current_limit().

See also
get_current_limit()

Definition at line 1214 of file motoron.py.

◆ set_current_sense_minimum_divisor() [1/2]

motoron.MotoronBase.set_current_sense_minimum_divisor ( self,
motor,
speed )
inherited

Sets the current sense minimum divisor setting for the specified motor, given a speed between 0 and 800.

This is one of the settings that determines how current sense readings are processed.

If you do not care about measuring motor current, you do not need to set this variable.

For more information, see the "Current sense minimum divisor" variable in the Motoron user's guide.

This only works for the high-power Motorons.

See also
get_current_sense_minimum_divisor()

Definition at line 1253 of file motoron.py.

◆ set_current_sense_minimum_divisor() [2/2]

motoron.MotoronBase.set_current_sense_minimum_divisor ( self,
motor,
speed )
inherited

Sets the current sense minimum divisor setting for the specified motor, given a speed between 0 and 800.

This is one of the settings that determines how current sense readings are processed.

If you do not care about measuring motor current, you do not need to set this variable.

For more information, see the "Current sense minimum divisor" variable in the Motoron user's guide.

This only works for the high-power Motorons.

See also
get_current_sense_minimum_divisor()

Definition at line 1253 of file motoron.py.

◆ set_current_sense_offset() [1/2]

motoron.MotoronBase.set_current_sense_offset ( self,
motor,
offset )
inherited

Sets the current sense offset setting for the specified motor.

This is one of the settings that determines how current sense readings are processed. It is supposed to be the value returned by get_current_sense_raw() when motor power is supplied to the Motoron and it is driving its motor outputs at speed 0.

The current_sense_calibrate example shows how to measure the current sense offsets and load them onto the Motoron using this function.

If you do not care about measuring motor current, you do not need to set this variable.

For more information, see the "Current sense offset" variable in the Motoron user's guide.

This only works for the high-power Motorons.

See also
get_current_sense_offset()

Definition at line 1229 of file motoron.py.

◆ set_current_sense_offset() [2/2]

motoron.MotoronBase.set_current_sense_offset ( self,
motor,
offset )
inherited

Sets the current sense offset setting for the specified motor.

This is one of the settings that determines how current sense readings are processed. It is supposed to be the value returned by get_current_sense_raw() when motor power is supplied to the Motoron and it is driving its motor outputs at speed 0.

The current_sense_calibrate example shows how to measure the current sense offsets and load them onto the Motoron using this function.

If you do not care about measuring motor current, you do not need to set this variable.

For more information, see the "Current sense offset" variable in the Motoron user's guide.

This only works for the high-power Motorons.

See also
get_current_sense_offset()

Definition at line 1229 of file motoron.py.

◆ set_direction_change_delay() [1/2]

motoron.MotoronBase.set_direction_change_delay ( self,
motor,
duration )
inherited

Sets the direction change delay of the specified motor (both directions), in units of 10 ms.

If this function succeeds, it is equivalent to calling set_direction_change_delay_forward() and set_direction_change_delay_reverse().

Definition at line 1203 of file motoron.py.

◆ set_direction_change_delay() [2/2]

motoron.MotoronBase.set_direction_change_delay ( self,
motor,
duration )
inherited

Sets the direction change delay of the specified motor (both directions), in units of 10 ms.

If this function succeeds, it is equivalent to calling set_direction_change_delay_forward() and set_direction_change_delay_reverse().

Definition at line 1203 of file motoron.py.

◆ set_direction_change_delay_forward() [1/2]

motoron.MotoronBase.set_direction_change_delay_forward ( self,
motor,
duration )
inherited

Sets the direction change delay of the specified motor for the forward direction, in units of 10 ms.

For more information, see the "Direction change delay forward" variable in the Motoron user's guide.

See also
set_direction_change_delay(), get_direction_change_delay_forward()

Definition at line 1179 of file motoron.py.

◆ set_direction_change_delay_forward() [2/2]

motoron.MotoronBase.set_direction_change_delay_forward ( self,
motor,
duration )
inherited

Sets the direction change delay of the specified motor for the forward direction, in units of 10 ms.

For more information, see the "Direction change delay forward" variable in the Motoron user's guide.

See also
set_direction_change_delay(), get_direction_change_delay_forward()

Definition at line 1179 of file motoron.py.

◆ set_direction_change_delay_reverse() [1/2]

motoron.MotoronBase.set_direction_change_delay_reverse ( self,
motor,
duration )
inherited

Sets the direction change delay of the specified motor for the reverse direction, in units of 10 ms.

For more information, see the "Direction change delay reverse" variable in the Motoron user's guide.

See also
set_direction_change_delay(), get_direction_change_delay_reverse()

Definition at line 1191 of file motoron.py.

◆ set_direction_change_delay_reverse() [2/2]

motoron.MotoronBase.set_direction_change_delay_reverse ( self,
motor,
duration )
inherited

Sets the direction change delay of the specified motor for the reverse direction, in units of 10 ms.

For more information, see the "Direction change delay reverse" variable in the Motoron user's guide.

See also
set_direction_change_delay(), get_direction_change_delay_reverse()

Definition at line 1191 of file motoron.py.

◆ set_error_mask() [1/2]

motoron.MotoronBase.set_error_mask ( self,
mask )
inherited

Sets the "Error mask" variable, which defines which status flags are considered to be errors.

For more information, see the "Error mask" variable in the Motoron user's guide.

See also
get_error_mask(), get_status_flags()

Definition at line 1021 of file motoron.py.

◆ set_error_mask() [2/2]

motoron.MotoronBase.set_error_mask ( self,
mask )
inherited

Sets the "Error mask" variable, which defines which status flags are considered to be errors.

For more information, see the "Error mask" variable in the Motoron user's guide.

See also
get_error_mask(), get_status_flags()

Definition at line 1021 of file motoron.py.

◆ set_error_response() [1/2]

motoron.MotoronBase.set_error_response ( self,
response )
inherited

Sets the error response, which defines how the Motoron will stop its motors when an error is happening.

The response parameter should be one of these constants from the motoron package:

  • motoron.ERROR_RESPONSE_COAST
  • motoron.ERROR_RESPONSE_BRAKE
  • motoron.ERROR_RESPONSE_COAST_NOW
  • motoron.ERROR_RESPONSE_BRAKE_NOW

For more information, see the "Error response" variable in the Motoron user's guide.

See also
get_error_response()

Definition at line 1001 of file motoron.py.

◆ set_error_response() [2/2]

motoron.MotoronBase.set_error_response ( self,
response )
inherited

Sets the error response, which defines how the Motoron will stop its motors when an error is happening.

The response parameter should be one of these constants from the motoron package:

  • motoron.ERROR_RESPONSE_COAST
  • motoron.ERROR_RESPONSE_BRAKE
  • motoron.ERROR_RESPONSE_COAST_NOW
  • motoron.ERROR_RESPONSE_BRAKE_NOW

For more information, see the "Error response" variable in the Motoron user's guide.

See also
get_error_response()

Definition at line 1001 of file motoron.py.

◆ set_latched_status_flags() [1/2]

motoron.MotoronBase.set_latched_status_flags ( self,
flags )
inherited

Sets the specified flags in get_status_flags().

For each bit in the flags argument that is 1, this command sets the corresponding bit in the "Status flags" variable to 1.

For more information, see the "Set latched status flags" command in the Motoron user's guide.

See also
get_status_flags(), set_latched_status_flags()

Definition at line 1350 of file motoron.py.

◆ set_latched_status_flags() [2/2]

motoron.MotoronBase.set_latched_status_flags ( self,
flags )
inherited

Sets the specified flags in get_status_flags().

For each bit in the flags argument that is 1, this command sets the corresponding bit in the "Status flags" variable to 1.

For more information, see the "Set latched status flags" command in the Motoron user's guide.

See also
get_status_flags(), set_latched_status_flags()

Definition at line 1350 of file motoron.py.

◆ set_max_acceleration() [1/2]

motoron.MotoronBase.set_max_acceleration ( self,
motor,
accel )
inherited

Sets the maximum acceleration of the specified motor (both directions).

If this function succeeds, it is equivalent to calling set_max_acceleration_forward() and set_max_acceleration_reverse().

Definition at line 1101 of file motoron.py.

◆ set_max_acceleration() [2/2]

motoron.MotoronBase.set_max_acceleration ( self,
motor,
accel )
inherited

Sets the maximum acceleration of the specified motor (both directions).

If this function succeeds, it is equivalent to calling set_max_acceleration_forward() and set_max_acceleration_reverse().

Definition at line 1101 of file motoron.py.

◆ set_max_acceleration_forward() [1/2]

motoron.MotoronBase.set_max_acceleration_forward ( self,
motor,
accel )
inherited

Sets the maximum acceleration of the specified motor for the forward direction.

For more information, see the "Max acceleration forward" variable in the Motoron user's guide.

See also
set_max_acceleration(), get_max_acceleration_forward()

Definition at line 1077 of file motoron.py.

◆ set_max_acceleration_forward() [2/2]

motoron.MotoronBase.set_max_acceleration_forward ( self,
motor,
accel )
inherited

Sets the maximum acceleration of the specified motor for the forward direction.

For more information, see the "Max acceleration forward" variable in the Motoron user's guide.

See also
set_max_acceleration(), get_max_acceleration_forward()

Definition at line 1077 of file motoron.py.

◆ set_max_acceleration_reverse() [1/2]

motoron.MotoronBase.set_max_acceleration_reverse ( self,
motor,
accel )
inherited

Sets the maximum acceleration of the specified motor for the reverse direction.

For more information, see the "Max acceleration reverse" variable in the Motoron user's guide.

See also
set_max_acceleration(), get_max_acceleration_reverse()

Definition at line 1089 of file motoron.py.

◆ set_max_acceleration_reverse() [2/2]

motoron.MotoronBase.set_max_acceleration_reverse ( self,
motor,
accel )
inherited

Sets the maximum acceleration of the specified motor for the reverse direction.

For more information, see the "Max acceleration reverse" variable in the Motoron user's guide.

See also
set_max_acceleration(), get_max_acceleration_reverse()

Definition at line 1089 of file motoron.py.

◆ set_max_deceleration() [1/2]

motoron.MotoronBase.set_max_deceleration ( self,
motor,
decel )
inherited

Sets the maximum deceleration of the specified motor (both directions).

If this function succeeds, it is equivalent to calling set_max_deceleration_forward() and set_max_deceleration_reverse().

Definition at line 1135 of file motoron.py.

◆ set_max_deceleration() [2/2]

motoron.MotoronBase.set_max_deceleration ( self,
motor,
decel )
inherited

Sets the maximum deceleration of the specified motor (both directions).

If this function succeeds, it is equivalent to calling set_max_deceleration_forward() and set_max_deceleration_reverse().

Definition at line 1135 of file motoron.py.

◆ set_max_deceleration_forward() [1/2]

motoron.MotoronBase.set_max_deceleration_forward ( self,
motor,
decel )
inherited

Sets the maximum deceleration of the specified motor for the forward direction.

For more information, see the "Max deceleration forward" variable in the Motoron user's guide.

See also
set_max_deceleration(), get_max_deceleration_forward()

Definition at line 1111 of file motoron.py.

◆ set_max_deceleration_forward() [2/2]

motoron.MotoronBase.set_max_deceleration_forward ( self,
motor,
decel )
inherited

Sets the maximum deceleration of the specified motor for the forward direction.

For more information, see the "Max deceleration forward" variable in the Motoron user's guide.

See also
set_max_deceleration(), get_max_deceleration_forward()

Definition at line 1111 of file motoron.py.

◆ set_max_deceleration_reverse() [1/2]

motoron.MotoronBase.set_max_deceleration_reverse ( self,
motor,
decel )
inherited

Sets the maximum deceleration of the specified motor for the reverse direction.

For more information, see the "Max deceleration reverse" variable in the Motoron user's guide.

See also
set_max_deceleration(), get_max_deceleration_reverse()

Definition at line 1123 of file motoron.py.

◆ set_max_deceleration_reverse() [2/2]

motoron.MotoronBase.set_max_deceleration_reverse ( self,
motor,
decel )
inherited

Sets the maximum deceleration of the specified motor for the reverse direction.

For more information, see the "Max deceleration reverse" variable in the Motoron user's guide.

See also
set_max_deceleration(), get_max_deceleration_reverse()

Definition at line 1123 of file motoron.py.

◆ set_protocol_options() [1/2]

motoron.MotoronBase.set_protocol_options ( self,
options )
inherited

Sends the "Set protocol options" command to the device to specify options related to how the device processes commands and sends responses.

The options are also saved in this object and are used later when sending other commands or reading responses.

When CRC for commands is enabled, this library generates the CRC byte and appends it to the end of each command it sends. The Motoron checks it to help ensure the command was received correctly.

When CRC for responses is enabled, this library reads the CRC byte sent by the Motoron in its responses and makes sure it is correct. If the response CRC byte is incorrect, get_last_error() will return a non-zero error code after the command has been run.

When the I2C general call address is enabled, the Motoron receives commands sent to address 0 in addition to its usual I2C address. The general call address is write-only; reading bytes from it is not supported.

By default (in this libary and the Motoron itself), CRC for commands and responses is enabled, and the I2C general call address is enabled.

This method always sends its command with a CRC byte, so it will work even if CRC was previously disabled but has been re-enabled on the device (e.g. due to a reset).

The options argument should be 0 or combination of the following expressions made using the bitwise or operator (|):

  • (1 << motoron.PROTOCOL_OPTION_CRC_FOR_COMMANDS)
  • (1 << motoron.PROTOCOL_OPTION_CRC_FOR_RESPONSES)
  • (1 << motoron.PROTOCOL_OPTION_I2C_GENERAL_CALL)

For more information, see the "Set protocol optons" command in the Motoron user's guide.

See also
enable_crc(), disable_crc(), enable_crc_for_commands(), disable_crc_for_commands(), enable_crc_for_responses(), disable_crc_for_responses(), enable_i2c_general_call(), disable_i2c_general_call()

Definition at line 79 of file motoron.py.

◆ set_protocol_options() [2/2]

motoron.MotoronBase.set_protocol_options ( self,
options )
inherited

Sends the "Set protocol options" command to the device to specify options related to how the device processes commands and sends responses.

The options are also saved in this object and are used later when sending other commands or reading responses.

When CRC for commands is enabled, this library generates the CRC byte and appends it to the end of each command it sends. The Motoron checks it to help ensure the command was received correctly.

When CRC for responses is enabled, this library reads the CRC byte sent by the Motoron in its responses and makes sure it is correct. If the response CRC byte is incorrect, get_last_error() will return a non-zero error code after the command has been run.

When the I2C general call address is enabled, the Motoron receives commands sent to address 0 in addition to its usual I2C address. The general call address is write-only; reading bytes from it is not supported.

By default (in this libary and the Motoron itself), CRC for commands and responses is enabled, and the I2C general call address is enabled.

This method always sends its command with a CRC byte, so it will work even if CRC was previously disabled but has been re-enabled on the device (e.g. due to a reset).

The options argument should be 0 or combination of the following expressions made using the bitwise or operator (|):

  • (1 << motoron.PROTOCOL_OPTION_CRC_FOR_COMMANDS)
  • (1 << motoron.PROTOCOL_OPTION_CRC_FOR_RESPONSES)
  • (1 << motoron.PROTOCOL_OPTION_I2C_GENERAL_CALL)

For more information, see the "Set protocol optons" command in the Motoron user's guide.

See also
enable_crc(), disable_crc(), enable_crc_for_commands(), disable_crc_for_commands(), enable_crc_for_responses(), disable_crc_for_responses(), enable_i2c_general_call(), disable_i2c_general_call()

Definition at line 79 of file motoron.py.

◆ set_protocol_options_locally() [1/2]

motoron.MotoronBase.set_protocol_options_locally ( self,
options )
inherited

Sets the protocol options for this object, without sending a command to the Motoron.

If the options you specify here do not match the actual configuration of the Motoron, future communication could fail.

Most users should use set_protocol_options() instead of this.

Definition at line 129 of file motoron.py.

◆ set_protocol_options_locally() [2/2]

motoron.MotoronBase.set_protocol_options_locally ( self,
options )
inherited

Sets the protocol options for this object, without sending a command to the Motoron.

If the options you specify here do not match the actual configuration of the Motoron, future communication could fail.

Most users should use set_protocol_options() instead of this.

Definition at line 129 of file motoron.py.

◆ set_pwm_mode() [1/2]

motoron.MotoronBase.set_pwm_mode ( self,
motor,
mode )
inherited

Sets the PWM mode for the specified motor.

The mode parameter should be one of the following these constants from the motoron package:

  • motoron.PWM_MODE_DEFAULT (20 kHz)
  • motoron.PWM_MODE_1_KHZ 1
  • motoron.PWM_MODE_2_KHZ 2
  • motoron.PWM_MODE_4_KHZ 3
  • motoron.PWM_MODE_5_KHZ 4
  • motoron.PWM_MODE_10_KHZ 5
  • motoron.PWM_MODE_20_KHZ 6
  • motoron.PWM_MODE_40_KHZ 7
  • motoron.PWM_MODE_80_KHZ 8

For more information, see the "PWM mode" variable in the Motoron user's guide.

See also
get_pwm_mode(self)

Definition at line 1053 of file motoron.py.

◆ set_pwm_mode() [2/2]

motoron.MotoronBase.set_pwm_mode ( self,
motor,
mode )
inherited

Sets the PWM mode for the specified motor.

The mode parameter should be one of the following these constants from the motoron package:

  • motoron.PWM_MODE_DEFAULT (20 kHz)
  • motoron.PWM_MODE_1_KHZ 1
  • motoron.PWM_MODE_2_KHZ 2
  • motoron.PWM_MODE_4_KHZ 3
  • motoron.PWM_MODE_5_KHZ 4
  • motoron.PWM_MODE_10_KHZ 5
  • motoron.PWM_MODE_20_KHZ 6
  • motoron.PWM_MODE_40_KHZ 7
  • motoron.PWM_MODE_80_KHZ 8

For more information, see the "PWM mode" variable in the Motoron user's guide.

See also
get_pwm_mode(self)

Definition at line 1053 of file motoron.py.

◆ set_speed() [1/2]

motoron.MotoronBase.set_speed ( self,
motor,
speed )
inherited

Sets the target speed of the specified motor.

The current speed will start moving to the specified target speed, obeying any acceleration and deceleration limits.

The motor number should be between 1 and the number of motors supported by the Motoron.

The speed should be between -800 and 800. Values outside that range will be clipped to -800 or 800 by the Motoron firmware.

For more information, see the "Set speed" command in the Motoron user's guide.

See also
set_speed_now(), set_all_speeds()

Definition at line 1369 of file motoron.py.

◆ set_speed() [2/2]

motoron.MotoronBase.set_speed ( self,
motor,
speed )
inherited

Sets the target speed of the specified motor.

The current speed will start moving to the specified target speed, obeying any acceleration and deceleration limits.

The motor number should be between 1 and the number of motors supported by the Motoron.

The speed should be between -800 and 800. Values outside that range will be clipped to -800 or 800 by the Motoron firmware.

For more information, see the "Set speed" command in the Motoron user's guide.

See also
set_speed_now(), set_all_speeds()

Definition at line 1369 of file motoron.py.

◆ set_speed_now() [1/2]

motoron.MotoronBase.set_speed_now ( self,
motor,
speed )
inherited

Sets the target and current speed of the specified motor, ignoring any acceleration and deceleration limits.

For more information, see the "Set speed" command in the Motoron user's guide.

See also
set_speed(), set_all_speeds_now()

Definition at line 1395 of file motoron.py.

◆ set_speed_now() [2/2]

motoron.MotoronBase.set_speed_now ( self,
motor,
speed )
inherited

Sets the target and current speed of the specified motor, ignoring any acceleration and deceleration limits.

For more information, see the "Set speed" command in the Motoron user's guide.

See also
set_speed(), set_all_speeds_now()

Definition at line 1395 of file motoron.py.

◆ set_starting_speed() [1/2]

motoron.MotoronBase.set_starting_speed ( self,
motor,
speed )
inherited

Sets the starting speed of the specified motor (both directions).

If this function succeeds, it is equivalent to calling set_starting_speed_forward() and set_starting_speed_reverse().

Definition at line 1169 of file motoron.py.

◆ set_starting_speed() [2/2]

motoron.MotoronBase.set_starting_speed ( self,
motor,
speed )
inherited

Sets the starting speed of the specified motor (both directions).

If this function succeeds, it is equivalent to calling set_starting_speed_forward() and set_starting_speed_reverse().

Definition at line 1169 of file motoron.py.

◆ set_starting_speed_forward() [1/2]

motoron.MotoronBase.set_starting_speed_forward ( self,
motor,
speed )
inherited

Sets the starting speed of the specified motor for the forward direction.

For more information, see the "Starting speed forward" variable in the Motoron user's guide.

See also
set_starting_speed(), get_starting_speed_forward()

Definition at line 1145 of file motoron.py.

◆ set_starting_speed_forward() [2/2]

motoron.MotoronBase.set_starting_speed_forward ( self,
motor,
speed )
inherited

Sets the starting speed of the specified motor for the forward direction.

For more information, see the "Starting speed forward" variable in the Motoron user's guide.

See also
set_starting_speed(), get_starting_speed_forward()

Definition at line 1145 of file motoron.py.

◆ set_starting_speed_reverse() [1/2]

motoron.MotoronBase.set_starting_speed_reverse ( self,
motor,
speed )
inherited

Sets the starting speed of the specified motor for the reverse direction.

For more information, see the "Starting speed reverse" variable in the Motoron user's guide.

See also
set_starting_speed(), get_starting_speed_reverse()

Definition at line 1157 of file motoron.py.

◆ set_starting_speed_reverse() [2/2]

motoron.MotoronBase.set_starting_speed_reverse ( self,
motor,
speed )
inherited

Sets the starting speed of the specified motor for the reverse direction.

For more information, see the "Starting speed reverse" variable in the Motoron user's guide.

See also
set_starting_speed(), get_starting_speed_reverse()

Definition at line 1157 of file motoron.py.

◆ set_variable() [1/2]

motoron.MotoronBase.set_variable ( self,
motor,
offset,
value )
inherited

Configures the Motoron using a "Set variable" command.

This library has helper methods to set every variable, so you should not need to call this function directly.

Parameters
motor0 to set a general variable, or a motor number to set motor-specific variables.
offsetThe address of the variable to set (only certain offsets are allowed).
valueThe value to set the variable to.
See also
get_variables()

Definition at line 963 of file motoron.py.

◆ set_variable() [2/2]

motoron.MotoronBase.set_variable ( self,
motor,
offset,
value )
inherited

Configures the Motoron using a "Set variable" command.

This library has helper methods to set every variable, so you should not need to call this function directly.

Parameters
motor0 to set a general variable, or a motor number to set motor-specific variables.
offsetThe address of the variable to set (only certain offsets are allowed).
valueThe value to set the variable to.
See also
get_variables()

Definition at line 963 of file motoron.py.

◆ write_eeprom() [1/2]

motoron.MotoronBase.write_eeprom ( self,
offset,
value )
inherited

Writes a value to one byte in the Motoron's EEPROM memory.

Warning: Be careful not to write to the EEPROM in a fast loop. The EEPROM memory of the Motoron's microcontroller is only rated for 100,000 erase/write cycles.

For more information, see the "Write EEPROM" command in the Motoron user's guide.

Definition at line 222 of file motoron.py.

◆ write_eeprom() [2/2]

motoron.MotoronBase.write_eeprom ( self,
offset,
value )
inherited

Writes a value to one byte in the Motoron's EEPROM memory.

Warning: Be careful not to write to the EEPROM in a fast loop. The EEPROM memory of the Motoron's microcontroller is only rated for 100,000 erase/write cycles.

For more information, see the "Write EEPROM" command in the Motoron user's guide.

Definition at line 222 of file motoron.py.

◆ write_eeprom16() [1/2]

motoron.MotoronBase.write_eeprom16 ( self,
offset,
value )
inherited

Writes a 2-byte value in the Motoron's EEPROM memory.

This command only has an effect if JMP1 is shorted to GND.

**Warning: Be careful not to write to the EEPROM in a fast loop. The EEPROM memory of the Motoron’s microcontroller is only rated for 100,000 erase/write cycles.

Definition at line 247 of file motoron.py.

◆ write_eeprom16() [2/2]

motoron.MotoronBase.write_eeprom16 ( self,
offset,
value )
inherited

Writes a 2-byte value in the Motoron's EEPROM memory.

This command only has an effect if JMP1 is shorted to GND.

**Warning: Be careful not to write to the EEPROM in a fast loop. The EEPROM memory of the Motoron’s microcontroller is only rated for 100,000 erase/write cycles.

Definition at line 247 of file motoron.py.

◆ write_eeprom_alternative_device_number() [1/2]

motoron.MotoronBase.write_eeprom_alternative_device_number ( self,
number )
inherited

Writes to the alternative device number stored in EEPROM, changing it to the specified value.

This function is only useful on Motorons with a serial interface, and only has an effect if JMP1 is shorted to GND.

Warning: Be careful not to write to the EEPROM in a fast loop. The EEPROM memory of the Motoron's microcontroller is only rated for 100,000 erase/write cycles.

See also
write_eeprom_disable_alternative_device_number()

Definition at line 273 of file motoron.py.

◆ write_eeprom_alternative_device_number() [2/2]

motoron.MotoronBase.write_eeprom_alternative_device_number ( self,
number )
inherited

Writes to the alternative device number stored in EEPROM, changing it to the specified value.

This function is only useful on Motorons with a serial interface, and only has an effect if JMP1 is shorted to GND.

Warning: Be careful not to write to the EEPROM in a fast loop. The EEPROM memory of the Motoron's microcontroller is only rated for 100,000 erase/write cycles.

See also
write_eeprom_disable_alternative_device_number()

Definition at line 273 of file motoron.py.

◆ write_eeprom_baud_rate() [1/2]

motoron.MotoronBase.write_eeprom_baud_rate ( self,
baud )
inherited

Writes to the baud rate stored in EEPROM, changing it to the specified value.

This function is only useful on Motorons with a serial interface, and only has an effect if JMP1 is shorted to GND.

Warning: Be careful not to write to the EEPROM in a fast loop. The EEPROM memory of the Motoron's microcontroller is only rated for 100,000 erase/write cycles.

Definition at line 323 of file motoron.py.

◆ write_eeprom_baud_rate() [2/2]

motoron.MotoronBase.write_eeprom_baud_rate ( self,
baud )
inherited

Writes to the baud rate stored in EEPROM, changing it to the specified value.

This function is only useful on Motorons with a serial interface, and only has an effect if JMP1 is shorted to GND.

Warning: Be careful not to write to the EEPROM in a fast loop. The EEPROM memory of the Motoron's microcontroller is only rated for 100,000 erase/write cycles.

Definition at line 323 of file motoron.py.

◆ write_eeprom_communication_options() [1/2]

motoron.MotoronBase.write_eeprom_communication_options ( self,
options )
inherited

Writes to the serial options byte stored in EEPROM, changing it to the specified value.

The bits in this byte are defined by the MOTORON_COMMUNICATION_OPTION_* constants.

This function is only useful on Motorons with a serial interface, and only has an effect if JMP1 is shorted to GND.

Warning: Be careful not to write to the EEPROM in a fast loop. The EEPROM memory of the Motoron's microcontroller is only rated for 100,000 erase/write cycles.

Definition at line 306 of file motoron.py.

◆ write_eeprom_communication_options() [2/2]

motoron.MotoronBase.write_eeprom_communication_options ( self,
options )
inherited

Writes to the serial options byte stored in EEPROM, changing it to the specified value.

The bits in this byte are defined by the MOTORON_COMMUNICATION_OPTION_* constants.

This function is only useful on Motorons with a serial interface, and only has an effect if JMP1 is shorted to GND.

Warning: Be careful not to write to the EEPROM in a fast loop. The EEPROM memory of the Motoron's microcontroller is only rated for 100,000 erase/write cycles.

Definition at line 306 of file motoron.py.

◆ write_eeprom_device_number() [1/2]

motoron.MotoronBase.write_eeprom_device_number ( self,
number )
inherited

Writes to the EEPROM device number, changing it to the specified value.

This command only has an effect if JMP1 is shorted to GND.

Warning: Be careful not to write to the EEPROM in a fast loop. The EEPROM memory of the Motoron's microcontroller is only rated for 100,000 erase/write cycles.

Definition at line 260 of file motoron.py.

◆ write_eeprom_device_number() [2/2]

motoron.MotoronBase.write_eeprom_device_number ( self,
number )
inherited

Writes to the EEPROM device number, changing it to the specified value.

This command only has an effect if JMP1 is shorted to GND.

Warning: Be careful not to write to the EEPROM in a fast loop. The EEPROM memory of the Motoron's microcontroller is only rated for 100,000 erase/write cycles.

Definition at line 260 of file motoron.py.

◆ write_eeprom_disable_alternative_device_number() [1/2]

motoron.MotoronBase.write_eeprom_disable_alternative_device_number ( self)
inherited

Writes to EEPROM to disable the alternative device number.

This function is only useful on Motorons with a serial interface, and only has an effect if JMP1 is shorted to GND.

Warning: Be careful not to write to the EEPROM in a fast loop. The EEPROM memory of the Motoron's microcontroller is only rated for 100,000 erase/write cycles.

See also
write_eeprom_alternative_device_number()

Definition at line 290 of file motoron.py.

◆ write_eeprom_disable_alternative_device_number() [2/2]

motoron.MotoronBase.write_eeprom_disable_alternative_device_number ( self)
inherited

Writes to EEPROM to disable the alternative device number.

This function is only useful on Motorons with a serial interface, and only has an effect if JMP1 is shorted to GND.

Warning: Be careful not to write to the EEPROM in a fast loop. The EEPROM memory of the Motoron's microcontroller is only rated for 100,000 erase/write cycles.

See also
write_eeprom_alternative_device_number()

Definition at line 290 of file motoron.py.

◆ write_eeprom_response_delay() [1/2]

motoron.MotoronBase.write_eeprom_response_delay ( self,
delay )
inherited

Writes to the serial response delay setting stored in EEPROM, changing it to the specified value, in units of microseconds.

This function is only useful on Motorons with a serial interface, and only has an effect if JMP1 is shorted to GND.

Warning: Be careful not to write to the EEPROM in a fast loop. The EEPROM memory of the Motoron's microcontroller is only rated for 100,000 erase/write cycles.

Definition at line 339 of file motoron.py.

◆ write_eeprom_response_delay() [2/2]

motoron.MotoronBase.write_eeprom_response_delay ( self,
delay )
inherited

Writes to the serial response delay setting stored in EEPROM, changing it to the specified value, in units of microseconds.

This function is only useful on Motorons with a serial interface, and only has an effect if JMP1 is shorted to GND.

Warning: Be careful not to write to the EEPROM in a fast loop. The EEPROM memory of the Motoron's microcontroller is only rated for 100,000 erase/write cycles.

Definition at line 339 of file motoron.py.

Member Data Documentation

◆ _msg

motoron.MotoronI2C._msg = smbus2.i2c_msg
protected

Definition at line 1717 of file motoron.py.

◆ _read_response

motoron.MotoronI2C._read_response = self._smbus_read_response
protected

Definition at line 1715 of file motoron.py.

◆ _send_command_core

motoron.MotoronI2C._send_command_core = self._smbus_send_command_core
protected

Definition at line 1714 of file motoron.py.

◆ address

motoron.MotoronI2C.address = address

The 7-bit I2C address used by this object.

The default is 16.

Definition at line 1691 of file motoron.py.

◆ bus

motoron.MotoronI2C.bus = bus

Definition at line 1722 of file motoron.py.

◆ DEFAULT_ERROR_MASK

tuple motoron.MotoronBase.DEFAULT_ERROR_MASK
staticinherited
Initial value:
= (
(1 << STATUS_FLAG_COMMAND_TIMEOUT) |
(1 << STATUS_FLAG_RESET))

The default value of the Motoron's "Error mask" variable.

Definition at line 49 of file motoron.py.

◆ protocol_options

tuple motoron.MotoronBase.protocol_options = MotoronBase.__DEFAULT_PROTOCOL_OPTIONS
inherited

The bits in this variable are defined by the motoron.PROTOCOL_OPTION_* constants.

See set_protocol_options().

Definition at line 56 of file motoron.py.


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