CALPOLY MECHATRONICS
Documentation for all Mechatronics Labs
motorDriver.py File Reference

A class to power a brushed, dc motor using PWM. More...

Classes

class  motorDriver.Motor
 The Motor class sets the power of a brushed, dc motor using PWM. More...
 

Variables

 motorDriver.pin_nSLEEP = pyb.Pin(pyb.Pin.cpu.A15, mode=pyb.Pin.OUT_PP, value=1);
 
 motorDriver.pin_IN1 = pyb.Pin(pyb.Pin.cpu.B4);
 
 motorDriver.pin_IN2 = pyb.Pin(pyb.Pin.cpu.B5);
 
 motorDriver.pin_IN3 = pyb.Pin(pyb.Pin.cpu.B0);
 
 motorDriver.pin_IN4 = pyb.Pin(pyb.Pin.cpu.B1);
 
 motorDriver.tim3 = pyb.Timer(3, freq = 20000);
 
 motorDriver.motor1 = Motor(pin_nSLEEP, pin_IN1, 1, pin_IN2, 2, tim3)
 
 motorDriver.motor2 = Motor(pin_nSLEEP, pin_IN3, 3, pin_IN4, 4, tim3)
 

Detailed Description

A class to power a brushed, dc motor using PWM.

The motorDriver.Motor class is used by the controller task, controller.Controller to set the duty cycle of the motor using PWM. Link to source code: https://bitbucket.org/ebriefer/me305_lab/src/master/Final%20Project/motorDriver.py

Author
Eliot Briefer