Pen Plotter Project
motor_clephan_mcgrath.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 set_duty_cycle (self, duty)
 This method sets the duty cycle to be sent to the motor to the given level. More...
 

Public Attributes

 timX
 
 ch1
 
 ch2
 

Detailed Description

This class implements a motor driver for an ME405 kit.

Constructor & Destructor Documentation

◆ __init__()

def motor_clephan_mcgrath.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_pinenables the motor driver
in1pinis the pin number associated with channel 2 of the motor
in2pinis the pin number associated with channel 1 of the motor

Member Function Documentation

◆ set_duty_cycle()

def motor_clephan_mcgrath.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
levelA signed integer holding the duty cycle of the voltage sent to the motor

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