Skip to content
This repository has been archived by the owner on Jun 25, 2021. It is now read-only.

motor.h

Joseph Ryan edited this page Aug 19, 2017 · 5 revisions

Go to the source code for motor.h

Includes

  • #include "gpio.h"

Functions

Function Documention


InitializeTLEMotor

Initializes a motor on a pair of pins for the TLE5205-2

tMotor *InitializeTLEMotor(tPin a, tPin b, tBoolean brake, tBoolean invert);

Parameters:

  • a Pin that should plug into the IN1 motor line
  • b Pin that should plug into the IN2 motor line
  • brake Flag to enable breaking when the motor is set to 0 speed
  • invert Flag to switch the direction that the motor will turn

Returns:

  • Pointer to an initialized tMotor, can be used by the SetMotor function

InitializeServoMotor

Initializes a motor on a single pin using rc pwm input

tMotor *InitializeServoMotor(tPin pin, tBoolean invert);

Parameters:

  • pin PWM signal line to motor
  • invert Flag to switch the direction that the motor will turn

Returns:

  • Pointer to an initialized tMotor, can be used by the SetMotor function

SetMotor

Sets a motor speed

void SetMotor(tMotor *mtr, float speed);

Parameters:

  • mtr Pointer to an initialized tMotor, returned by InitializeMotor
  • speed Float on range [-1, 1] where -1 means maximum backward speed and 1 means maximum forward speed

Clone this wiki locally