Ball Balancer Project
Classes | Variables
motor.py File Reference

Motor class to initialize and set up the motors in DRV8847.py. More...

Classes

class  motor.Motor
 A motor class for one channel of the DRV8847. More...
 

Variables

 motor.PWM_tim = Timer(3, freq = 20_000)
 
 motor.motor_1 = Motor(PWM_tim, Pin.cpu.B4, Pin.cpu.B5, 1)
 
 motor.motor_2 = Motor(PWM_tim, Pin.cpu.B0, Pin.cpu.B1, 2)
 
 motor.nSLEEP = Pin(Pin.cpu.A15, mode=Pin.OUT_PP)
 

Detailed Description

Motor class to initialize and set up the motors in DRV8847.py.

This motor class initializes the pins with the motor object to be enabled. Additionally, it allows for a pulse width modulation control that changes the speed of the motor. This allows for the Motor to move clockwise and counterclockwise at difference speeds.