Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
phidgets::Motor Class Referencefinal

#include <motor.h>

Public Member Functions

void backEMFChangeHandler (double back_emf) const
 
void dutyCycleChangeHandler (double duty_cycle) const
 
double getAcceleration () const
 
double getBackEMF () const
 
double getBraking () const
 
double getDutyCycle () const
 
 Motor (int32_t serial_number, int hub_port, bool is_hub_port_device, int channel, std::function< void(int, double)> duty_cycle_change_handler, std::function< void(int, double)> back_emf_change_handler)
 
void setAcceleration (double acceleration) const
 
void setBraking (double braking) const
 
void setDataInterval (uint32_t data_interval_ms) const
 
void setDutyCycle (double duty_cycle) const
 
 ~Motor ()
 

Static Private Member Functions

static void BackEMFChangeHandler (PhidgetDCMotorHandle motor_handle, void *ctx, double back_emf)
 
static void DutyCycleChangeHandler (PhidgetDCMotorHandle motor_handle, void *ctx, double duty_cycle)
 

Private Attributes

std::function< void(int, double)> back_emf_change_handler_
 
int channel_
 
std::function< void(int, double)> duty_cycle_change_handler_
 
PhidgetDCMotorHandle motor_handle_
 

Detailed Description

Definition at line 41 of file motor.h.

Constructor & Destructor Documentation

◆ Motor()

phidgets::Motor::Motor ( int32_t  serial_number,
int  hub_port,
bool  is_hub_port_device,
int  channel,
std::function< void(int, double)>  duty_cycle_change_handler,
std::function< void(int, double)>  back_emf_change_handler 
)
explicit

Definition at line 40 of file motor.cpp.

◆ ~Motor()

phidgets::Motor::~Motor ( )

Definition at line 81 of file motor.cpp.

Member Function Documentation

◆ backEMFChangeHandler()

void phidgets::Motor::backEMFChangeHandler ( double  back_emf) const

Definition at line 197 of file motor.cpp.

◆ BackEMFChangeHandler()

void phidgets::Motor::BackEMFChangeHandler ( PhidgetDCMotorHandle  motor_handle,
void *  ctx,
double  back_emf 
)
staticprivate

Definition at line 208 of file motor.cpp.

◆ dutyCycleChangeHandler()

void phidgets::Motor::dutyCycleChangeHandler ( double  duty_cycle) const

Definition at line 192 of file motor.cpp.

◆ DutyCycleChangeHandler()

void phidgets::Motor::DutyCycleChangeHandler ( PhidgetDCMotorHandle  motor_handle,
void *  ctx,
double  duty_cycle 
)
staticprivate

Definition at line 202 of file motor.cpp.

◆ getAcceleration()

double phidgets::Motor::getAcceleration ( ) const

Definition at line 113 of file motor.cpp.

◆ getBackEMF()

double phidgets::Motor::getBackEMF ( ) const

Definition at line 139 of file motor.cpp.

◆ getBraking()

double phidgets::Motor::getBraking ( ) const

Definition at line 164 of file motor.cpp.

◆ getDutyCycle()

double phidgets::Motor::getDutyCycle ( ) const

Definition at line 87 of file motor.cpp.

◆ setAcceleration()

void phidgets::Motor::setAcceleration ( double  acceleration) const

Definition at line 127 of file motor.cpp.

◆ setBraking()

void phidgets::Motor::setBraking ( double  braking) const

Definition at line 179 of file motor.cpp.

◆ setDataInterval()

void phidgets::Motor::setDataInterval ( uint32_t  data_interval_ms) const

Definition at line 152 of file motor.cpp.

◆ setDutyCycle()

void phidgets::Motor::setDutyCycle ( double  duty_cycle) const

Definition at line 101 of file motor.cpp.

Member Data Documentation

◆ back_emf_change_handler_

std::function<void(int, double)> phidgets::Motor::back_emf_change_handler_
private

Definition at line 70 of file motor.h.

◆ channel_

int phidgets::Motor::channel_
private

Definition at line 68 of file motor.h.

◆ duty_cycle_change_handler_

std::function<void(int, double)> phidgets::Motor::duty_cycle_change_handler_
private

Definition at line 69 of file motor.h.

◆ motor_handle_

PhidgetDCMotorHandle phidgets::Motor::motor_handle_
private

Definition at line 71 of file motor.h.


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


phidgets_api
Author(s): Tully Foote, Ivan Dryanovski
autogenerated on Sun May 11 2025 02:20:27