My Project
motor.MotorDriver Class Reference

This class implements a motor driver for the ME 305 Nucleo board. More...

Public Member Functions

def __init__ (self, nSLEEP_pin, IN1_pin, IN2_pin, timer)
 
def enable (self)
 activates the power flow by turning on the nSleep_pin
 
def disable (self)
 deactivates the power flow by turning off the nSleep_pin
 
def set_duty (self, duty)
 

Public Attributes

 nSLEEP_pin
 A pyb.Pin object to use as the enable pin.
 
 IN1_pin
 A pyb.Pin object to use as the input to half bridge 1.
 
 IN2_pin
 A pyb.Pin object to use as the input to half bridge 2.
 
 timer
 A pyb.Timer object to use for PWM generation on 17IN1_pin and IN2_pin.
 
 TIM
 timer object with timer object
 
 IN1
 Connect Motor's pin 1 with timer channel.
 
 IN2
 Connect Motor's pin 2 with timer channel.
 
 EN
 object to power the pins on or off
 

Detailed Description

This class implements a motor driver for the ME 305 Nucleo board.

Constructor & Destructor Documentation

◆ __init__()

def motor.MotorDriver.__init__ (   self,
  nSLEEP_pin,
  IN1_pin,
  IN2_pin,
  timer 
)

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

Parameters
nSLEEP_pinA pyb.Pin object to use as the enable pin.
IN1_pinA pyb.Pin object to use as the input to half bridge 1.
IN2_pinA pyb.Pin object to use as the input to half bridge 2.
timerA pyb.Timer object to use for PWM generation on 17IN1_pin and IN2_pin.

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