Matthew's Portfolio
motorDriverChannel.motorDriverChannel Class Reference

Public Member Functions

def __init__ (self, IN1_pin, IN2_pin, IN_timer, ch1, ch2, mChFlag=False)
 Creates a motor driver channel object by initializing GPIO pins. More...
 
def setLevel (self, level)
 Set the level of the motors. More...
 

Public Attributes

 IN_timer
 The timer for the motors. More...
 
 IN1_pin
 The timer channel object for half bridge 1 of the motor. More...
 
 IN2_pin
 The timer channel object for half bridge 2 of the motor. More...
 
 mChFlag
 Debugging flag for detailed analysis while running.
 

Constructor & Destructor Documentation

◆ __init__()

def motorDriverChannel.motorDriverChannel.__init__ (   self,
  IN1_pin,
  IN2_pin,
  IN_timer,
  ch1,
  ch2,
  mChFlag = False 
)

Creates a motor driver channel object by initializing GPIO pins.

Example:
self.motX = self.motorDriverObj.channel(Pin.cpu.B0, Pin.cpu.B1, Timer(3, freq=20000), 3, 4, mChFlag = False)

Parameters
IN1_pinFirst PWM pin object
IN2_pinSecond PWM pin object
IN_timerA pyb.Timer object with correct timer number and frequency
ch1First timer channel number
ch2Second timer channel number
mChFlagDebugging flag

Member Function Documentation

◆ setLevel()

def motorDriverChannel.motorDriverChannel.setLevel (   self,
  level 
)

Set the level of the motors.

This method sets the duty cycle to be sent to the motor to the given level. Positive values cause effort in one direction, negative values in the opposite direction.

Parameters
levelA signed integer holding the new duty cycle of the PWM signal sent to the motor.

Member Data Documentation

◆ IN1_pin

motorDriverChannel.motorDriverChannel.IN1_pin

The timer channel object for half bridge 1 of the motor.

This timer channel will be set to PWM in order to control the quadrature encoders at a specified channel number

◆ IN2_pin

motorDriverChannel.motorDriverChannel.IN2_pin

The timer channel object for half bridge 2 of the motor.

This timer channel will be set to PWM in order to control the quadrature encoders at a specified channel number

◆ IN_timer

motorDriverChannel.motorDriverChannel.IN_timer

The timer for the motors.

This is passed in with the specified timer number and frequency


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