-
Notifications
You must be signed in to change notification settings - Fork 0
/
MotorHelper.h
43 lines (35 loc) · 1021 Bytes
/
MotorHelper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* File: MotorHelper.h
* Author: ros
*
* Created on 12. Mai 2011, 15:44
*/
#ifndef MOTORHELPER_H
#define MOTORHELPER_H
#include <SerialStream.h> // TODO: Serielle Verbindung zum Arduino funktioniert nicht, weil die BAUD RATE nicht stimmt!!!
using namespace LibSerial;
typedef enum {
GoingForward,
GoingBackward,
TurningLeft,
TurningRight,
Stopped
} MovementState;
class MotorHelper {
public:
static MovementState State;
static void TurnLeft(unsigned char speed);
static void TurnRight(unsigned char speed);
static void Stop();
static void GoForward(unsigned char speed);
static void GoBackward(unsigned char speed);
static void Reset();
static void Initialize();
MotorHelper();
MotorHelper(const MotorHelper& orig);
virtual ~MotorHelper();
private:
static SerialStream arduinoConnection;
static void RawSend(unsigned char directionA, unsigned char directionB, unsigned char A, unsigned char B);
};
#endif /* MOTORHELPER_H */