Robobo
DCMotor Class Reference

#include <DCMotor.h>

Inherits ActiveObject, and MotorI.

Public Member Functions

void setPinModes ()
 
void reset ()
 
 DCMotor (uint8_t encoderAPinV, uint8_t encoderBPinV, uint8_t hBridgeAPinV, uint8_t hBridgeBPinV, uint8_t voltagePinV, ControlStrategy *strategy)
 
void setPosition (int32_t)
 
int32_t getPosition ()
 
void stop (void)
 
void enableReports (TickType_t period)
 
void reportMethod (void)
 
void updateControl (void)
 
void encoderInterrupt (void)
 
- Public Member Functions inherited from ActiveObject
TimerHandle_t createTimer (MethodRequestBase *mr, const TickType_t xTimerPeriod, const UBaseType_t uxAutoReload)
 
uint8_t executeMethod (MethodRequestBase *mr)
 

Public Attributes

uint8_t encoderAPin
 
uint8_t encoderBPin
 
uint8_t hBridgeAPin
 
uint8_t hBridgeBPin
 
uint8_t voltagePin
 
uint8_t encoderAVal
 
uint8_t encoderBVal
 
uint8_t encoderAPrevVal
 
uint8_t encoderBPrevVal
 
int32_t encoderPosition
 
int32_t requestedPosition
 
int8_t direction
 
float kP
 
float kI
 
int32_t integral
 

Friends

int main (void)
 Application entry point. More...
 

Detailed Description

Motor class is to represent all data associated with DC Motor.

Motor class captures two wires from DC motor encoder. Stores previous and current value of encoder signal.

Member Function Documentation

void DCMotor::encoderInterrupt ( void  )
virtual

This method is called on interrupt associated with encoder

Implements MotorI.

void DCMotor::reset ( void  )
virtual

Nulls out private areas of class

Implements MotorI.

void DCMotor::setPinModes ( void  )

This function is responsible for seting correct pin modes in Arduino

Friends And Related Function Documentation

int main ( void  )
friend

Application entry point.

Returns
Unused (ANSI-C compatibility).

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