ME 305
Functions
task_motor.py File Reference

Directly interfaces with motors. More...

Functions

def task_motor.taskMotor (taskname, period, motor_1, motor_2, mFlag, MFlag, duty, duty_1, duty_2, eFlag, mode, bFlag)
 Task that is in charge of any alterations to drivers or motors. More...
 

Detailed Description

Directly interfaces with motors.

Task file to set duty cycle of motor 1 or motor 2. Interfaces with driver.py driver file to interact with the motor. Contains logic to ensure there are no improper duty cycle inputs.

Author
Ryan Dean
Zachary Hendrix
Date
2/17/2022

Function Documentation

◆ taskMotor()

def task_motor.taskMotor (   taskname,
  period,
  motor_1,
  motor_2,
  mFlag,
  MFlag,
  duty,
  duty_1,
  duty_2,
  eFlag,
  mode,
  bFlag 
)

Task that is in charge of any alterations to drivers or motors.

This task sets the duty cycle for both mototr as well as enables driver to allow said motors to operate

Parameters
tasknameThe name of the task
periodThis task is designed to work cooperatively with other tasks. The period is how long it should take for the code to circle back and do this task
motor_1Object to control duty cycle of motor 1
motor_2Object ot control duty cycle of motor 2
duty_1Shared variable containing duty cycle for motor 1
duty_2Shared variable containing duty cycle for motor 2
modeFlag that only allows program to run when ball balancing mode is enabled.