Ball Balancer Project
Functions | Variables
taskMotor.py File Reference

The task that interfaces with the motors. More...

Functions

def taskMotor.taskMotorFcn (taskName, period, Duty1, Duty2)
 This function interacts with the DRV8847 driver and corresponding motors. More...
 

Variables

 taskMotor.S0_INIT = micropython.const(0)
 
 taskMotor.S1_SET = micropython.const(1)
 
 taskMotor.S2_CLEAR = micropython.const(2)
 

Detailed Description

The task that interfaces with the motors.

This task's main function is to set the duty cycle of either motor while handling external interruptions. This task will be the only task communicating with the motor.py and DRV8847.py driver modules.

@author     Jake Lesher
@author     Daniel Xu
@date       02/16/2022

Function Documentation

◆ taskMotorFcn()

def taskMotor.taskMotorFcn (   taskName,
  period,
  Duty1,
  Duty2 
)

This function interacts with the DRV8847 driver and corresponding motors.

This function calls upon the driver to set the duty cycle percentage for both motors. After initialization this fucntion will repeat, setting the speed of each motor to Duty1 and Duty2.

Parameters
taskNameis the name associated the with taskMotor in main.py.
perioddetermines the frequency at which taskUser is to run.
Duty1is the shared queue containing the requested duty cycle percentage for motor 1.
Duty2is the shared queue containing the requested duty cycle percentage for motor 2.