Plot Something - ME 405 Term Project
motor_agena_chiu.MotorDriver Class Reference

This class implements a motor driver for an ME405 kit. More...

Public Member Functions

def __init__ (self, en_pin, in1pin, in2pin, timer)
 Creates a motor driver by initializing GPIO pins and turning the motor off for safety. More...
 
def enable (self)
 Enables the motor, allowing power to it.
 
def disable (self)
 Disables the motor, preventing power to it.
 
def set_duty_cycle (self, duty)
 This method sets the duty cycle to be sent to the motor to the given level. More...
 

Public Attributes

 EN
 The pin variable for the enable pin on the Nucleo.
 
 tim
 The timer variable for the motor.
 
 pin1
 A pin variable to recieve the duty cycles.
 
 pin2
 A pin variable to recieve the duty cycles.
 
 ch1
 The channel variable for channel 1 and pin1.
 
 ch2
 The channel variable for channel 2 and pin2.
 

Detailed Description

This class implements a motor driver for an ME405 kit.

Constructor & Destructor Documentation

◆ __init__()

def motor_agena_chiu.MotorDriver.__init__ (   self,
  en_pin,
  in1pin,
  in2pin,
  timer 
)

Creates a motor driver by initializing GPIO pins and turning the motor off for safety.

Parameters
en_pinpin for enabling the motor.
in1pinpin 1 to control the motor.
in2pinpin 2 to control the motor.
timertimer to use for motor channels.

Member Function Documentation

◆ set_duty_cycle()

def motor_agena_chiu.MotorDriver.set_duty_cycle (   self,
  duty 
)

This method sets the duty cycle to be sent to the motor to the given level.

Positive values cause torque in one direction, negative values in the opposite direction.

Parameters
dutyA signed integer holding the duty cycle of the voltage sent to the motor

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