Wicked Device Motor Shield
Software Library for Wicked Device Motor Shield
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Wicked_DCMotor Class Reference

#include <WickedMotorShield.h>

Inheritance diagram for Wicked_DCMotor:
WickedMotorShield

Public Member Functions

 Wicked_DCMotor (uint8_t motor_number, uint8_t use_alternate_pins=0)
 
void setSpeed (uint8_t pwm_val)
 
void setDirection (uint8_t direction)
 
void setBrake (uint8_t brake_type)
 
uint16_t currentSense (void)
 
- Public Member Functions inherited from WickedMotorShield
 WickedMotorShield (uint8_t use_alternate_pins=0)
 

Private Member Functions

uint8_t get_motor_direction (void)
 

Private Attributes

uint8_t motor_number
 

Additional Inherited Members

- Static Public Member Functions inherited from WickedMotorShield
static uint32_t getRCIN (uint8_t rc_input_number, uint32_t timeout=0)
 
static uint8_t version (void)
 
- Protected Member Functions inherited from WickedMotorShield
uint8_t get_shift_register_value (uint8_t motor_number)
 
void apply_mask (uint8_t *shift_register_value, uint8_t mask, uint8_t operation)
 
uint8_t filter_mask (uint8_t shift_register_value, uint8_t mask)
 
void set_shift_register_value (uint8_t motor_number, uint8_t value)
 
void load_shift_register (void)
 
uint8_t get_motor_directionM (uint8_t motor_number)
 
uint8_t get_motor_brakeM (uint8_t motor_number)
 
void setSpeedM (uint8_t motor_number, uint8_t pwm_val)
 
void setDirectionData (uint8_t motor_number, uint8_t direction)
 
void setBrakeData (uint8_t motor_number, uint8_t brake_type)
 
- Static Protected Attributes inherited from WickedMotorShield
static uint8_t M1_PWM_PIN = 11
 
static uint8_t M6_PWM_PIN = 3
 
static uint8_t old_dir [6] = {0,0,0,0,0,0}
 

Detailed Description

Definition at line 254 of file WickedMotorShield.h.

Constructor & Destructor Documentation

◆ Wicked_DCMotor()

Wicked_DCMotor::Wicked_DCMotor ( uint8_t  motor_number,
uint8_t  use_alternate_pins = 0 
)

Definition at line 610 of file WickedMotorShield.cpp.

Member Function Documentation

◆ currentSense()

uint16_t Wicked_DCMotor::currentSense ( void  )

Definition at line 632 of file WickedMotorShield.cpp.

◆ get_motor_direction()

uint8_t Wicked_DCMotor::get_motor_direction ( void  )
private

Definition at line 628 of file WickedMotorShield.cpp.

◆ setBrake()

void Wicked_DCMotor::setBrake ( uint8_t  brake_type)

Set the type of braking for the motor.

Parameters
brake_typeOptions are BRAKE_HARD, BRAKE_SOFT, and BRAKE_OFF.

It is assumed that BRAKE_HARD refers to dynamic braking with the leads on the motor connected together, BRAKE_SOFT refers to the situation where no power flows through the motor or both leads are connected to ground, and BRAKE_OFF refers to power being applied to DC motor.

Definition at line 623 of file WickedMotorShield.cpp.

◆ setDirection()

void Wicked_DCMotor::setDirection ( uint8_t  direction)

Set the direction of rotation of the motor.

Definition at line 617 of file WickedMotorShield.cpp.

◆ setSpeed()

void Wicked_DCMotor::setSpeed ( uint8_t  pwm_val)

Set the speed of rotation as a value in the range 0..255.

Parameters
pwm_valValue for speed with an integer in the range 0 to 255.

Definition at line 651 of file WickedMotorShield.cpp.

Member Data Documentation

◆ motor_number

uint8_t Wicked_DCMotor::motor_number
private

Definition at line 257 of file WickedMotorShield.h.


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