Goncalo Costa / SMC02B
Embed: (wiki syntax)

« Back to documentation index

SMC02B Class Reference

SMC02B Class Reference

Pololu Micro Dual Serial Motor Controller. More...

#include <SMC02B.h>

Public Member Functions

 SMC02B (PinName tx, PinName rx, PinName rst)
 Constructor.
void SMC02B_RST (void)
 Reset SMC02B.
void SMC02B_MOTOR_SET (char motor, char direction, char speed)
 Set Motor.
void SMC02B_MOTOR_BRAKE (char motor)
 Set Motor to Brake.
void SMC02B_MOTOR_COAST (char motor)
 Set Motor to idle.
void SMC02B_CONFIG (char mode, char motor)
 Configure SMC02B.

Detailed Description

Pololu Micro Dual Serial Motor Controller.

Definition at line 64 of file SMC02B.h.


Constructor & Destructor Documentation

SMC02B ( PinName  tx,
PinName  rx,
PinName  rst 
)

Constructor.

Includes.

Parameters:
txmbed pin to use for TX line of Serial.
rxmbed pin to use for RX line of Serial.
rstmbed pin to use for RESET.

Definition at line 6 of file SMC02B.cpp.


Member Function Documentation

void SMC02B_CONFIG ( char  mode,
char  motor 
)

Configure SMC02B.

Parameters:
mode- Set mode 1 or 2 motor mode. 0 - 2 motors 1 - 1 motor
motor- Motor number.

Allways reset SMC02B after a config

Definition at line 65 of file SMC02B.cpp.

void SMC02B_MOTOR_BRAKE ( char  motor )

Set Motor to Brake.

Parameters:
motor- Motor to be controlled.

Definition at line 40 of file SMC02B.cpp.

void SMC02B_MOTOR_COAST ( char  motor )

Set Motor to idle.

Parameters:
motor- Motor to be controlled.

Definition at line 50 of file SMC02B.cpp.

void SMC02B_MOTOR_SET ( char  motor,
char  direction,
char  speed 
)

Set Motor.

Parameters:
motor- Motor to be controlled.
direction- Motor Direction. 0 - Reverse 1 - Forward
speed- Motor Speed. 0 - 127 ( 0x7F )

Definition at line 30 of file SMC02B.cpp.

void SMC02B_RST ( void   )

Reset SMC02B.

Definition at line 12 of file SMC02B.cpp.