Motor Class.
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...
|
|
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...
|
|
|
| in1 |
| Object to contain pin tied to motor for PWM control.
|
|
| in2 |
| Object to contain pin tied to motor for PWM control.
|
|
Motor Class.
Consists of methods and attributes to set the speed of a motor.
◆ __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
-
channel | Contains channel number for specific motor used |
PWM_tim | Contains the the timer value for proper PWM |
IN1_pin | Object to interface with pin that determines rotation direction |
IN2_pin | Object 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
-
channel | Contains channel number for specific motor used |
PWM_tim | Contains the the timer value for proper PWM |
IN1_pin | Object to interface with pin that determines rotation direction |
IN2_pin | Object 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
-
channel | Contains channel number for specific motor used |
PWM_tim | Contains the the timer value for proper PWM |
IN1_pin | Object to interface with pin that determines rotation direction |
IN2_pin | Object to interface with pin that determines rotation direction |
- Returns
- None
◆ set_duty() [1/3]
def motor.Motor.set_duty |
( |
|
self, |
|
|
|
duty |
|
) |
| |
Sets duty cycle of motors.
- Parameters
-
duty | Contains 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
-
duty | Contains 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
-
duty | Contains float or integer value for duty cycle of motor. |
- Returns
- None
The documentation for this class was generated from the following files: