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

Public Member Functions

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

Public Attributes

 protocol_options
 

Static Public Attributes

tuple DEFAULT_ERROR_MASK
 

Protected Member Functions

def _send_command (self, cmd)
 
def _send_command_and_read_response (self, cmd, response_length)
 
def _send_command (self, cmd)
 
def _send_command_and_read_response (self, cmd, response_length)
 

Detailed Description

Represents a connection to a Pololu Motoron Motoron Controller.

Definition at line 36 of file motoron.py.

Constructor & Destructor Documentation

◆ __init__() [1/2]

def motoron.MotoronBase.__init__ (   self)

Reimplemented in motoron.MotoronI2C, motoron.MotoronI2C, motoron.MotoronSerial, and motoron.MotoronSerial.

Definition at line 51 of file motoron.py.

◆ __init__() [2/2]

def motoron.MotoronBase.__init__ (   self)

Reimplemented in motoron.MotoronI2C, motoron.MotoronI2C, motoron.MotoronSerial, and motoron.MotoronSerial.

Definition at line 51 of file motoron.py.

Member Function Documentation

◆ _send_command() [1/2]

def motoron.MotoronBase._send_command (   self,
  cmd 
)
protected

Definition at line 1620 of file motoron.py.

◆ _send_command() [2/2]

def motoron.MotoronBase._send_command (   self,
  cmd 
)
protected

Definition at line 1620 of file motoron.py.

◆ _send_command_and_read_response() [1/2]

def motoron.MotoronBase._send_command_and_read_response (   self,
  cmd,
  response_length 
)
protected

Definition at line 1624 of file motoron.py.

◆ _send_command_and_read_response() [2/2]

def motoron.MotoronBase._send_command_and_read_response (   self,
  cmd,
  response_length 
)
protected

Definition at line 1624 of file motoron.py.

◆ clear_latched_status_flags() [1/2]

def motoron.MotoronBase.clear_latched_status_flags (   self,
  flags 
)

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 1309 of file motoron.py.

◆ clear_latched_status_flags() [2/2]

def motoron.MotoronBase.clear_latched_status_flags (   self,
  flags 
)

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 1309 of file motoron.py.

◆ clear_motor_fault() [1/2]

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

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 1283 of file motoron.py.

◆ clear_motor_fault() [2/2]

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

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 1283 of file motoron.py.

◆ clear_motor_fault_unconditional() [1/2]

def motoron.MotoronBase.clear_motor_fault_unconditional (   self)

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 1299 of file motoron.py.

◆ clear_motor_fault_unconditional() [2/2]

def motoron.MotoronBase.clear_motor_fault_unconditional (   self)

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 1299 of file motoron.py.

◆ clear_reset_flag() [1/2]

def motoron.MotoronBase.clear_reset_flag (   self)

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 1328 of file motoron.py.

◆ clear_reset_flag() [2/2]

def motoron.MotoronBase.clear_reset_flag (   self)

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 1328 of file motoron.py.

◆ coast_now() [1/2]

def motoron.MotoronBase.coast_now (   self)

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 1272 of file motoron.py.

◆ coast_now() [2/2]

def motoron.MotoronBase.coast_now (   self)

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 1272 of file motoron.py.

◆ disable_command_timeout() [1/2]

def motoron.MotoronBase.disable_command_timeout (   self)

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 1032 of file motoron.py.

◆ disable_command_timeout() [2/2]

def motoron.MotoronBase.disable_command_timeout (   self)

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 1032 of file motoron.py.

◆ disable_crc() [1/2]

def motoron.MotoronBase.disable_crc (   self)

Disables CRC for commands and responses.

See set_protocol_options().

Definition at line 147 of file motoron.py.

◆ disable_crc() [2/2]

def motoron.MotoronBase.disable_crc (   self)

Disables CRC for commands and responses.

See set_protocol_options().

Definition at line 147 of file motoron.py.

◆ disable_crc_for_commands() [1/2]

def motoron.MotoronBase.disable_crc_for_commands (   self)

Disables CRC for commands.

See set_protocol_options().

Definition at line 162 of file motoron.py.

◆ disable_crc_for_commands() [2/2]

def motoron.MotoronBase.disable_crc_for_commands (   self)

Disables CRC for commands.

See set_protocol_options().

Definition at line 162 of file motoron.py.

◆ disable_crc_for_responses() [1/2]

def motoron.MotoronBase.disable_crc_for_responses (   self)

Disables CRC for responses.

See set_protocol_options().

Definition at line 176 of file motoron.py.

◆ disable_crc_for_responses() [2/2]

def motoron.MotoronBase.disable_crc_for_responses (   self)

Disables CRC for responses.

See set_protocol_options().

Definition at line 176 of file motoron.py.

◆ disable_i2c_general_call() [1/2]

def motoron.MotoronBase.disable_i2c_general_call (   self)

Disables the I2C general call address.

See set_protocol_options().

Definition at line 190 of file motoron.py.

◆ disable_i2c_general_call() [2/2]

def motoron.MotoronBase.disable_i2c_general_call (   self)

Disables the I2C general call address.

See set_protocol_options().

Definition at line 190 of file motoron.py.

◆ enable_crc() [1/2]

def motoron.MotoronBase.enable_crc (   self)

Enables CRC for commands and responses.

See set_protocol_options().

Definition at line 139 of file motoron.py.

◆ enable_crc() [2/2]

def motoron.MotoronBase.enable_crc (   self)

Enables CRC for commands and responses.

See set_protocol_options().

Definition at line 139 of file motoron.py.

◆ enable_crc_for_commands() [1/2]

def motoron.MotoronBase.enable_crc_for_commands (   self)

Enables CRC for commands.

See set_protocol_options().

Definition at line 155 of file motoron.py.

◆ enable_crc_for_commands() [2/2]

def motoron.MotoronBase.enable_crc_for_commands (   self)

Enables CRC for commands.

See set_protocol_options().

Definition at line 155 of file motoron.py.

◆ enable_crc_for_responses() [1/2]

def motoron.MotoronBase.enable_crc_for_responses (   self)

Enables CRC for responses.

See set_protocol_options().

Definition at line 169 of file motoron.py.

◆ enable_crc_for_responses() [2/2]

def motoron.MotoronBase.enable_crc_for_responses (   self)

Enables CRC for responses.

See set_protocol_options().

Definition at line 169 of file motoron.py.

◆ enable_i2c_general_call() [1/2]

def motoron.MotoronBase.enable_i2c_general_call (   self)

Enables the I2C general call address.

See set_protocol_options().

Definition at line 183 of file motoron.py.

◆ enable_i2c_general_call() [2/2]

def motoron.MotoronBase.enable_i2c_general_call (   self)

Enables the I2C general call address.

See set_protocol_options().

Definition at line 183 of file motoron.py.

◆ get_buffered_speed() [1/2]

def motoron.MotoronBase.get_buffered_speed (   self,
  motor 
)

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]

def motoron.MotoronBase.get_buffered_speed (   self,
  motor 
)

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]

def motoron.MotoronBase.get_command_timeout_latched_flag (   self)

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 523 of file motoron.py.

◆ get_command_timeout_latched_flag() [2/2]

def motoron.MotoronBase.get_command_timeout_latched_flag (   self)

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 523 of file motoron.py.

◆ get_command_timeout_milliseconds() [1/2]

def motoron.MotoronBase.get_command_timeout_milliseconds (   self)

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]

def motoron.MotoronBase.get_command_timeout_milliseconds (   self)

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]

def motoron.MotoronBase.get_crc_error_flag (   self)

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 514 of file motoron.py.

◆ get_crc_error_flag() [2/2]

def motoron.MotoronBase.get_crc_error_flag (   self)

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 514 of file motoron.py.

◆ get_current_limit() [1/2]

def motoron.MotoronBase.get_current_limit (   self,
  motor 
)

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]

def motoron.MotoronBase.get_current_limit (   self,
  motor 
)

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]

def motoron.MotoronBase.get_current_sense_minimum_divisor (   self,
  motor 
)

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 947 of file motoron.py.

◆ get_current_sense_minimum_divisor() [2/2]

def motoron.MotoronBase.get_current_sense_minimum_divisor (   self,
  motor 
)

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 947 of file motoron.py.

◆ get_current_sense_offset() [1/2]

def motoron.MotoronBase.get_current_sense_offset (   self,
  motor 
)

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 934 of file motoron.py.

◆ get_current_sense_offset() [2/2]

def motoron.MotoronBase.get_current_sense_offset (   self,
  motor 
)

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 934 of file motoron.py.

◆ get_current_sense_processed() [1/2]

def motoron.MotoronBase.get_current_sense_processed (   self,
  motor 
)

Reads the processed current sense reading for the specified motor.

This only works for the high-power Motorons.

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.

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]

def motoron.MotoronBase.get_current_sense_processed (   self,
  motor 
)

Reads the processed current sense reading for the specified motor.

This only works for the high-power Motorons.

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.

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]

def motoron.MotoronBase.get_current_sense_processed_and_speed (   self,
  motor 
)

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

This only works for the high-power Motorons.

Definition at line 887 of file motoron.py.

◆ get_current_sense_processed_and_speed() [2/2]

def motoron.MotoronBase.get_current_sense_processed_and_speed (   self,
  motor 
)

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

This only works for the high-power Motorons.

Definition at line 887 of file motoron.py.

◆ get_current_sense_raw() [1/2]

def motoron.MotoronBase.get_current_sense_raw (   self,
  motor 
)

Reads the raw current sense measurement for the specified motor.

This only works for the high-power Motorons.

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]

def motoron.MotoronBase.get_current_sense_raw (   self,
  motor 
)

Reads the raw current sense measurement for the specified motor.

This only works for the high-power Motorons.

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]

def motoron.MotoronBase.get_current_sense_raw_and_speed (   self,
  motor 
)

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

This only works for the high-power Motorons.

Definition at line 876 of file motoron.py.

◆ get_current_sense_raw_and_speed() [2/2]

def motoron.MotoronBase.get_current_sense_raw_and_speed (   self,
  motor 
)

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

This only works for the high-power Motorons.

Definition at line 876 of file motoron.py.

◆ get_current_sense_reading() [1/2]

def motoron.MotoronBase.get_current_sense_reading (   self,
  motor 
)

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 high-power Motorons.

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]

def motoron.MotoronBase.get_current_sense_reading (   self,
  motor 
)

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 high-power Motorons.

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]

def motoron.MotoronBase.get_current_speed (   self,
  motor 
)

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]

def motoron.MotoronBase.get_current_speed (   self,
  motor 
)

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]

def motoron.MotoronBase.get_direction_change_delay_forward (   self,
  motor 
)

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]

def motoron.MotoronBase.get_direction_change_delay_forward (   self,
  motor 
)

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]

def motoron.MotoronBase.get_direction_change_delay_reverse (   self,
  motor 
)

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]

def motoron.MotoronBase.get_direction_change_delay_reverse (   self,
  motor 
)

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]

def motoron.MotoronBase.get_error_active_flag (   self)

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 584 of file motoron.py.

◆ get_error_active_flag() [2/2]

def motoron.MotoronBase.get_error_active_flag (   self)

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 584 of file motoron.py.

◆ get_error_mask() [1/2]

def motoron.MotoronBase.get_error_mask (   self)

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]

def motoron.MotoronBase.get_error_mask (   self)

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]

def motoron.MotoronBase.get_error_response (   self)

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]

def motoron.MotoronBase.get_error_response (   self)

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]

def motoron.MotoronBase.get_firmware_version (   self)

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 56 of file motoron.py.

◆ get_firmware_version() [2/2]

def motoron.MotoronBase.get_firmware_version (   self)

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 56 of file motoron.py.

◆ get_jumper_state() [1/2]

def motoron.MotoronBase.get_jumper_state (   self)

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]

def motoron.MotoronBase.get_jumper_state (   self)

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]

def motoron.MotoronBase.get_max_acceleration_forward (   self,
  motor 
)

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]

def motoron.MotoronBase.get_max_acceleration_forward (   self,
  motor 
)

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]

def motoron.MotoronBase.get_max_acceleration_reverse (   self,
  motor 
)

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]

def motoron.MotoronBase.get_max_acceleration_reverse (   self,
  motor 
)

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]

def motoron.MotoronBase.get_max_deceleration_forward (   self,
  motor 
)

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]

def motoron.MotoronBase.get_max_deceleration_forward (   self,
  motor 
)

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]

def motoron.MotoronBase.get_max_deceleration_reverse (   self,
  motor 
)

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]

def motoron.MotoronBase.get_max_deceleration_reverse (   self,
  motor 
)

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]

def motoron.MotoronBase.get_motor_driving_flag (   self)

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 602 of file motoron.py.

◆ get_motor_driving_flag() [2/2]

def motoron.MotoronBase.get_motor_driving_flag (   self)

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 602 of file motoron.py.

◆ get_motor_fault_latched_flag() [1/2]

def motoron.MotoronBase.get_motor_fault_latched_flag (   self)

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 532 of file motoron.py.

◆ get_motor_fault_latched_flag() [2/2]

def motoron.MotoronBase.get_motor_fault_latched_flag (   self)

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 532 of file motoron.py.

◆ get_motor_faulting_flag() [1/2]

def motoron.MotoronBase.get_motor_faulting_flag (   self)

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 566 of file motoron.py.

◆ get_motor_faulting_flag() [2/2]

def motoron.MotoronBase.get_motor_faulting_flag (   self)

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 566 of file motoron.py.

◆ get_motor_output_enabled_flag() [1/2]

def motoron.MotoronBase.get_motor_output_enabled_flag (   self)

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 593 of file motoron.py.

◆ get_motor_output_enabled_flag() [2/2]

def motoron.MotoronBase.get_motor_output_enabled_flag (   self)

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 593 of file motoron.py.

◆ get_no_power_flag() [1/2]

def motoron.MotoronBase.get_no_power_flag (   self)

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 575 of file motoron.py.

◆ get_no_power_flag() [2/2]

def motoron.MotoronBase.get_no_power_flag (   self)

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 575 of file motoron.py.

◆ get_no_power_latched_flag() [1/2]

def motoron.MotoronBase.get_no_power_latched_flag (   self)

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 541 of file motoron.py.

◆ get_no_power_latched_flag() [2/2]

def motoron.MotoronBase.get_no_power_latched_flag (   self)

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 541 of file motoron.py.

◆ get_protocol_error_flag() [1/2]

def motoron.MotoronBase.get_protocol_error_flag (   self)

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 505 of file motoron.py.

◆ get_protocol_error_flag() [2/2]

def motoron.MotoronBase.get_protocol_error_flag (   self)

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 505 of file motoron.py.

◆ get_pwm_mode() [1/2]

def motoron.MotoronBase.get_pwm_mode (   self,
  motor 
)

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]

def motoron.MotoronBase.get_pwm_mode (   self,
  motor 
)

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]

def motoron.MotoronBase.get_reset_flag (   self)

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 550 of file motoron.py.

◆ get_reset_flag() [2/2]

def motoron.MotoronBase.get_reset_flag (   self)

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 550 of file motoron.py.

◆ get_starting_speed_forward() [1/2]

def motoron.MotoronBase.get_starting_speed_forward (   self,
  motor 
)

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]

def motoron.MotoronBase.get_starting_speed_forward (   self,
  motor 
)

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]

def motoron.MotoronBase.get_starting_speed_reverse (   self,
  motor 
)

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]

def motoron.MotoronBase.get_starting_speed_reverse (   self,
  motor 
)

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]

def motoron.MotoronBase.get_status_flags (   self)

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:

  • get_protocol_error_flag()
  • get_crc_error_flag()
  • get_command_timeout_latched_flag()
  • get_motor_fault_latched_flag()
  • get_no_power_latched_flag()
  • get_reset_flag()
  • get_motor_faulting_flag()
  • get_no_power_flag()
  • get_error_active_flag()
  • get_motor_output_enabled_flag()
  • get_motor_driving_flag()

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 452 of file motoron.py.

◆ get_status_flags() [2/2]

def motoron.MotoronBase.get_status_flags (   self)

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:

  • get_protocol_error_flag()
  • get_crc_error_flag()
  • get_command_timeout_latched_flag()
  • get_motor_fault_latched_flag()
  • get_no_power_latched_flag()
  • get_reset_flag()
  • get_motor_faulting_flag()
  • get_no_power_flag()
  • get_error_active_flag()
  • get_motor_output_enabled_flag()
  • get_motor_driving_flag()

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 452 of file motoron.py.

◆ get_target_brake_amount() [1/2]

def motoron.MotoronBase.get_target_brake_amount (   self,
  motor 
)

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]

def motoron.MotoronBase.get_target_brake_amount (   self,
  motor 
)

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]

def motoron.MotoronBase.get_target_speed (   self,
  motor 
)

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]

def motoron.MotoronBase.get_target_speed (   self,
  motor 
)

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]

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

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 440 of file motoron.py.

◆ get_var_s16() [2/2]

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

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 440 of file motoron.py.

◆ get_var_u16() [1/2]

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

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 428 of file motoron.py.

◆ get_var_u16() [2/2]

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

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 428 of file motoron.py.

◆ get_var_u8() [1/2]

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

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 417 of file motoron.py.

◆ get_var_u8() [2/2]

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

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 417 of file motoron.py.

◆ get_variables() [1/2]

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

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 396 of file motoron.py.

◆ get_variables() [2/2]

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

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 396 of file motoron.py.

◆ get_vin_voltage() [1/2]

def motoron.MotoronBase.get_vin_voltage (   self)

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 611 of file motoron.py.

◆ get_vin_voltage() [2/2]

def motoron.MotoronBase.get_vin_voltage (   self)

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 611 of file motoron.py.

◆ get_vin_voltage_mv() [1/2]

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

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_mvOptional argument that specifies the reference voltage (voltage on the 3V3 pin), in millivolts. This is assumed to be 3300 by default, but you can provide a different value for a more accurate conversion.
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 622 of file motoron.py.

◆ get_vin_voltage_mv() [2/2]

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

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_mvOptional argument that specifies the reference voltage (voltage on the 3V3 pin), in millivolts. This is assumed to be 3300 by default, but you can provide a different value for a more accurate conversion.
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 622 of file motoron.py.

◆ read_eeprom() [1/2]

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

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 197 of file motoron.py.

◆ read_eeprom() [2/2]

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

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 197 of file motoron.py.

◆ read_eeprom_device_number() [1/2]

def motoron.MotoronBase.read_eeprom_device_number (   self)

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 211 of file motoron.py.

◆ read_eeprom_device_number() [2/2]

def motoron.MotoronBase.read_eeprom_device_number (   self)

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 211 of file motoron.py.

◆ reinitialize() [1/2]

def motoron.MotoronBase.reinitialize (   self)

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 351 of file motoron.py.

◆ reinitialize() [2/2]

def motoron.MotoronBase.reinitialize (   self)

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 351 of file motoron.py.

◆ reset() [1/2]

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

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 366 of file motoron.py.

◆ reset() [2/2]

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

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 366 of file motoron.py.

◆ reset_command_timeout() [1/2]

def motoron.MotoronBase.reset_command_timeout (   self)

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 1604 of file motoron.py.

◆ reset_command_timeout() [2/2]

def motoron.MotoronBase.reset_command_timeout (   self)

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 1604 of file motoron.py.

◆ set_all_buffered_speeds() [1/2]

def motoron.MotoronBase.set_all_buffered_speeds (   self,
speeds 
)

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 speed 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 1494 of file motoron.py.

◆ set_all_buffered_speeds() [2/2]

def motoron.MotoronBase.set_all_buffered_speeds (   self,
speeds 
)

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 speed 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 1494 of file motoron.py.

◆ set_all_speeds() [1/2]

def motoron.MotoronBase.set_all_speeds (   self,
speeds 
)

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 1434 of file motoron.py.

◆ set_all_speeds() [2/2]

def motoron.MotoronBase.set_all_speeds (   self,
speeds 
)

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 1434 of file motoron.py.

◆ set_all_speeds_now() [1/2]

def motoron.MotoronBase.set_all_speeds_now (   self,
speeds 
)

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 1470 of file motoron.py.

◆ set_all_speeds_now() [2/2]

def motoron.MotoronBase.set_all_speeds_now (   self,
speeds 
)

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 1470 of file motoron.py.

◆ set_all_speeds_now_using_buffers() [1/2]

def motoron.MotoronBase.set_all_speeds_now_using_buffers (   self)

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 1533 of file motoron.py.

◆ set_all_speeds_now_using_buffers() [2/2]

def motoron.MotoronBase.set_all_speeds_now_using_buffers (   self)

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 1533 of file motoron.py.

◆ set_all_speeds_using_buffers() [1/2]

def motoron.MotoronBase.set_all_speeds_using_buffers (   self)

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 1520 of file motoron.py.

◆ set_all_speeds_using_buffers() [2/2]

def motoron.MotoronBase.set_all_speeds_using_buffers (   self)

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 1520 of file motoron.py.

◆ set_braking() [1/2]

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

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 1547 of file motoron.py.

◆ set_braking() [2/2]

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

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 1547 of file motoron.py.

◆ set_braking_now() [1/2]

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

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 1576 of file motoron.py.

◆ set_braking_now() [2/2]

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

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 1576 of file motoron.py.

◆ set_buffered_speed() [1/2]

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

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 1412 of file motoron.py.

◆ set_buffered_speed() [2/2]

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

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 1412 of file motoron.py.

◆ set_command_timeout_milliseconds() [1/2]

def motoron.MotoronBase.set_command_timeout_milliseconds (   self,
  ms 
)

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 987 of file motoron.py.

◆ set_command_timeout_milliseconds() [2/2]

def motoron.MotoronBase.set_command_timeout_milliseconds (   self,
  ms 
)

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 987 of file motoron.py.

◆ set_current_limit() [1/2]

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

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 1213 of file motoron.py.

◆ set_current_limit() [2/2]

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

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 1213 of file motoron.py.

◆ set_current_sense_minimum_divisor() [1/2]

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

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 1252 of file motoron.py.

◆ set_current_sense_minimum_divisor() [2/2]

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

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 1252 of file motoron.py.

◆ set_current_sense_offset() [1/2]

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

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 1228 of file motoron.py.

◆ set_current_sense_offset() [2/2]

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

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 1228 of file motoron.py.

◆ set_direction_change_delay() [1/2]

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

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 1202 of file motoron.py.

◆ set_direction_change_delay() [2/2]

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

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 1202 of file motoron.py.

◆ set_direction_change_delay_forward() [1/2]

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

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 1178 of file motoron.py.

◆ set_direction_change_delay_forward() [2/2]

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

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 1178 of file motoron.py.

◆ set_direction_change_delay_reverse() [1/2]

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

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 1190 of file motoron.py.

◆ set_direction_change_delay_reverse() [2/2]

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

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 1190 of file motoron.py.

◆ set_error_mask() [1/2]

def motoron.MotoronBase.set_error_mask (   self,
  mask 
)

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 1020 of file motoron.py.

◆ set_error_mask() [2/2]

def motoron.MotoronBase.set_error_mask (   self,
  mask 
)

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 1020 of file motoron.py.

◆ set_error_response() [1/2]

def motoron.MotoronBase.set_error_response (   self,
  response 
)

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 1000 of file motoron.py.

◆ set_error_response() [2/2]

def motoron.MotoronBase.set_error_response (   self,
  response 
)

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 1000 of file motoron.py.

◆ set_latched_status_flags() [1/2]

def motoron.MotoronBase.set_latched_status_flags (   self,
  flags 
)

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 1349 of file motoron.py.

◆ set_latched_status_flags() [2/2]

def motoron.MotoronBase.set_latched_status_flags (   self,
  flags 
)

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 1349 of file motoron.py.

◆ set_max_acceleration() [1/2]

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

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 1100 of file motoron.py.

◆ set_max_acceleration() [2/2]

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

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 1100 of file motoron.py.

◆ set_max_acceleration_forward() [1/2]

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

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 1076 of file motoron.py.

◆ set_max_acceleration_forward() [2/2]

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

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 1076 of file motoron.py.

◆ set_max_acceleration_reverse() [1/2]

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

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 1088 of file motoron.py.

◆ set_max_acceleration_reverse() [2/2]

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

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 1088 of file motoron.py.

◆ set_max_deceleration() [1/2]

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

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 1134 of file motoron.py.

◆ set_max_deceleration() [2/2]

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

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 1134 of file motoron.py.

◆ set_max_deceleration_forward() [1/2]

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

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 1110 of file motoron.py.

◆ set_max_deceleration_forward() [2/2]

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

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 1110 of file motoron.py.

◆ set_max_deceleration_reverse() [1/2]

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

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 1122 of file motoron.py.

◆ set_max_deceleration_reverse() [2/2]

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

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 1122 of file motoron.py.

◆ set_protocol_options() [1/2]

def motoron.MotoronBase.set_protocol_options (   self,
  options 
)

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 77 of file motoron.py.

◆ set_protocol_options() [2/2]

def motoron.MotoronBase.set_protocol_options (   self,
  options 
)

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 77 of file motoron.py.

◆ set_protocol_options_locally() [1/2]

def motoron.MotoronBase.set_protocol_options_locally (   self,
  options 
)

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 127 of file motoron.py.

◆ set_protocol_options_locally() [2/2]

def motoron.MotoronBase.set_protocol_options_locally (   self,
  options 
)

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 127 of file motoron.py.

◆ set_pwm_mode() [1/2]

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

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 1052 of file motoron.py.

◆ set_pwm_mode() [2/2]

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

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 1052 of file motoron.py.

◆ set_speed() [1/2]

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

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 1368 of file motoron.py.

◆ set_speed() [2/2]

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

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 1368 of file motoron.py.

◆ set_speed_now() [1/2]

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

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 1394 of file motoron.py.

◆ set_speed_now() [2/2]

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

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 1394 of file motoron.py.

◆ set_starting_speed() [1/2]

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

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 1168 of file motoron.py.

◆ set_starting_speed() [2/2]

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

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 1168 of file motoron.py.

◆ set_starting_speed_forward() [1/2]

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

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 1144 of file motoron.py.

◆ set_starting_speed_forward() [2/2]

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

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 1144 of file motoron.py.

◆ set_starting_speed_reverse() [1/2]

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

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 1156 of file motoron.py.

◆ set_starting_speed_reverse() [2/2]

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

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 1156 of file motoron.py.

◆ set_variable() [1/2]

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

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 962 of file motoron.py.

◆ set_variable() [2/2]

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

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 962 of file motoron.py.

◆ write_eeprom() [1/2]

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

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 220 of file motoron.py.

◆ write_eeprom() [2/2]

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

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 220 of file motoron.py.

◆ write_eeprom16() [1/2]

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

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 245 of file motoron.py.

◆ write_eeprom16() [2/2]

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

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 245 of file motoron.py.

◆ write_eeprom_alternative_device_number() [1/2]

def motoron.MotoronBase.write_eeprom_alternative_device_number (   self,
  number 
)

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 271 of file motoron.py.

◆ write_eeprom_alternative_device_number() [2/2]

def motoron.MotoronBase.write_eeprom_alternative_device_number (   self,
  number 
)

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 271 of file motoron.py.

◆ write_eeprom_baud_rate() [1/2]

def motoron.MotoronBase.write_eeprom_baud_rate (   self,
  baud 
)

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 321 of file motoron.py.

◆ write_eeprom_baud_rate() [2/2]

def motoron.MotoronBase.write_eeprom_baud_rate (   self,
  baud 
)

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 321 of file motoron.py.

◆ write_eeprom_communication_options() [1/2]

def motoron.MotoronBase.write_eeprom_communication_options (   self,
  options 
)

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 304 of file motoron.py.

◆ write_eeprom_communication_options() [2/2]

def motoron.MotoronBase.write_eeprom_communication_options (   self,
  options 
)

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 304 of file motoron.py.

◆ write_eeprom_device_number() [1/2]

def motoron.MotoronBase.write_eeprom_device_number (   self,
  number 
)

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 258 of file motoron.py.

◆ write_eeprom_device_number() [2/2]

def motoron.MotoronBase.write_eeprom_device_number (   self,
  number 
)

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 258 of file motoron.py.

◆ write_eeprom_disable_alternative_device_number() [1/2]

def motoron.MotoronBase.write_eeprom_disable_alternative_device_number (   self)

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 288 of file motoron.py.

◆ write_eeprom_disable_alternative_device_number() [2/2]

def motoron.MotoronBase.write_eeprom_disable_alternative_device_number (   self)

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 288 of file motoron.py.

◆ write_eeprom_response_delay() [1/2]

def motoron.MotoronBase.write_eeprom_response_delay (   self,
  delay 
)

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 337 of file motoron.py.

◆ write_eeprom_response_delay() [2/2]

def motoron.MotoronBase.write_eeprom_response_delay (   self,
  delay 
)

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 337 of file motoron.py.

Member Data Documentation

◆ DEFAULT_ERROR_MASK

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

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

Definition at line 47 of file motoron.py.

◆ protocol_options

motoron.MotoronBase.protocol_options

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

See set_protocol_options().

Definition at line 54 of file motoron.py.


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