NXPCUP-libary
Library for car's control board on NXPCUP competition based on the Mbed framework.
Classes | Public Member Functions | List of all members
nxpcup::Motor Class Reference

#include <Motor.h>

Classes

struct  Config
 

Public Member Functions

 Motor (const PinName pin0, const PinName pin1)
 
 Motor (const Config &config)
 
void power (int power)
 
void setMaxPowerPercent (int percent)
 
int maxPowerPercent () const
 
int maxPower () const
 

Constructor & Destructor Documentation

nxpcup::Motor::Motor ( const PinName  pin0,
const PinName  pin1 
)
inline

Constructor of class Motor.

Parameters
pin0name of the pin for motor driver (require PWM)
pin0name of the pin for motor driver (require PWM)
nxpcup::Motor::Motor ( const Config config)
inline

Constructor of class Motor.

Parameters
configstructureConfig}

Member Function Documentation

int nxpcup::Motor::maxPower ( ) const
inline

Return the constant maximal power.

int nxpcup::Motor::maxPowerPercent ( ) const
inline

Return the actual maximal motor power in percent (0 <-> 100).

void nxpcup::Motor::power ( int  power)
inline

Set motor power.

Parameters
powerof the motor (-1000 <-> 1000) under 0 => backward, over 0 => forward, 0 stop
void nxpcup::Motor::setMaxPowerPercent ( int  percent)
inline

Set the maximal motor power in percent.

Parameters
percentof the maximal power (0 <-> 100) function power() has still same range

The documentation for this class was generated from the following file: