Pololu Zumo Shield Arduino Library
ZumoMotors.h
Go to the documentation of this file.
1 
10 #ifndef ZumoMotors_h
11 #define ZumoMotors_h
12 
13 #include <Arduino.h>
14 
16 {
17  public:
18 
19  // constructor (doesn't do anything)
20  ZumoMotors();
21 
22  // enable/disable flipping of motors
23  static void flipLeftMotor(boolean flip);
24  static void flipRightMotor(boolean flip);
25 
26  // set speed for left, right, or both motors
27  static void setLeftSpeed(int speed);
28  static void setRightSpeed(int speed);
29  static void setSpeeds(int leftSpeed, int rightSpeed);
30 
31  private:
32 
33  static inline void init()
34  {
35  static boolean initialized = false;
36 
37  if (!initialized)
38  {
39  initialized = true;
40  init2();
41  }
42  }
43 
44  // initializes timer1 for proper PWM generation
45  static void init2();
46 };
47 
48 #endif
ZumoMotors
Control motor speed and direction.
Definition: ZumoMotors.h:16