22 lines
408 B
C++
22 lines
408 B
C++
#ifndef _ROBOCUP_MOTOR_H_
|
|
#define _ROBOCUP_MOTOR_H_
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
class Motor {
|
|
private:
|
|
volatile uint8_t *port;
|
|
volatile uint8_t *pwmPort;
|
|
uint8_t fwdMask;
|
|
uint8_t revMask;
|
|
|
|
int speed;
|
|
public:
|
|
Motor(volatile uint8_t *port, volatile uint8_t *pwmPort, uint8_t fwdMask, uint8_t revMask);
|
|
|
|
void setSpeed(int speed);
|
|
int getSpeed() {return speed;}
|
|
};
|
|
|
|
#endif
|