Control the Pololu SMC02B
SMC02B.h
- Committer:
- goncaloc
- Date:
- 2010-10-11
- Revision:
- 0:33043894c6cb
- Child:
- 1:683f2848e917
File content as of revision 0:33043894c6cb:
#ifndef SMC02B_H #define SMC02B_H /** * Includes */ #include "mbed.h" /** * Defines */ #define SMC02B_START_BYTE 0x80 #define SMC02B_CONFIG_BYTE 0x02 #define SMC02B_DEVICE_ID 0x00 #define SMC02B_BYTE3 0x00 #define SMC02B_BYTE4 0x00 #define SMC02B_MOTOR1_DIR 0x00 #define SMC02B_MOTOR1_SPEED 0x00 #define SMC02B_MOTOR1_NUMBER 0x00 #define SMC02B_MOTOR2_DIR 0x00 #define SMC02B_MOTOR2_SPEED 0x00 #define SMC02B_MOTOR2_NUMBER 0x00 class SMC02B { public: SMC02B(PinName tx, PinName rx, PinName pin); void SMC02B_RST(void); void SMC02B_MOTOR_SET( char motor, char direction, char speed ); void SMC02B_MOTOR_BRAKE( char motor ); void SMC02B_MOTOR_COAST( char motor ); void SMC02B_CONFIG( char mode, char motor ); private: DigitalOut _rst; Serial* _SMC02B; }; #endif