ME 305
Public Member Functions | Public Attributes | List of all members
motor.Motor Class Reference

Motor Class. More...

Public Member Functions

def __init__ (self, channel, PWM_tim, IN1_pin, IN2_pin)
 Initializes a motor object. More...
 
def set_duty (self, duty)
 Sets duty cycle of motors. More...
 
def __init__ (self, channel, PWM_tim, IN1_pin, IN2_pin)
 Initializes a motor object. More...
 
def set_duty (self, duty)
 Sets duty cycle of motors. More...
 
def __init__ (self, channel, PWM_tim, IN1_pin, IN2_pin)
 Initializes a motor object. More...
 
def set_duty (self, duty)
 Sets duty cycle of motors. More...
 

Public Attributes

 in1
 Object to contain pin tied to motor for PWM control.
 
 in2
 Object to contain pin tied to motor for PWM control.
 

Detailed Description

Motor Class.

Consists of methods and attributes to set the speed of a motor.

Constructor & Destructor Documentation

◆ __init__() [1/3]

def motor.Motor.__init__ (   self,
  channel,
  PWM_tim,
  IN1_pin,
  IN2_pin 
)

Initializes a motor object.

Initializes a motor object of the driver class. This uses the channels built-in to the motor and sets the proper parameters to cause the motor to spin.

Parameters
channelContains channel number for specific motor used
PWM_timContains the the timer value for proper PWM
IN1_pinObject to interface with pin that determines rotation direction
IN2_pinObject to interface with pin that determines rotation direction
Returns
None

◆ __init__() [2/3]

def motor.Motor.__init__ (   self,
  channel,
  PWM_tim,
  IN1_pin,
  IN2_pin 
)

Initializes a motor object.

Initializes a motor object of the driver class. This uses the channels built-in to the motor and sets the proper parameters to cause the motor to spin.

Parameters
channelContains channel number for specific motor used
PWM_timContains the the timer value for proper PWM
IN1_pinObject to interface with pin that determines rotation direction
IN2_pinObject to interface with pin that determines rotation direction
Returns
None

◆ __init__() [3/3]

def motor.Motor.__init__ (   self,
  channel,
  PWM_tim,
  IN1_pin,
  IN2_pin 
)

Initializes a motor object.

Initializes a motor object of the driver class. This uses the channels built-in to the motor and sets the proper parameters to cause the motor to spin.

Parameters
channelContains channel number for specific motor used
PWM_timContains the the timer value for proper PWM
IN1_pinObject to interface with pin that determines rotation direction
IN2_pinObject to interface with pin that determines rotation direction
Returns
None

Member Function Documentation

◆ set_duty() [1/3]

def motor.Motor.set_duty (   self,
  duty 
)

Sets duty cycle of motors.

Parameters
dutyContains float or integer value for duty cycle of motor.
Returns
None

◆ set_duty() [2/3]

def motor.Motor.set_duty (   self,
  duty 
)

Sets duty cycle of motors.

Parameters
dutyContains float or integer value for duty cycle of motor.
Returns
None

◆ set_duty() [3/3]

def motor.Motor.set_duty (   self,
  duty 
)

Sets duty cycle of motors.

Parameters
dutyContains float or integer value for duty cycle of motor.
Returns
None

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