AStar32U4 library
AStar32U4Motors.h
Go to the documentation of this file.
1 // Copyright Pololu Corporation. For more information, see http://www.pololu.com/
2 
5 #pragma once
6 
7 #include <stdint.h>
8 
21 {
22  public:
23 
33  static void flipM1(bool flip);
34 
44  static void flipM2(bool flip);
45 
51  static void setM1Speed(int16_t speed);
52 
58  static void setM2Speed(int16_t speed);
59 
68  static void setSpeeds(int16_t m2Speed, int16_t m1Speed);
69 
70  private:
71 
72  static inline void init()
73  {
74  static bool initialized = false;
75 
76  if (!initialized)
77  {
78  initialized = true;
79  init2();
80  }
81  }
82 
83  static void init2();
84 };
static void setM2Speed(int16_t speed)
Sets the speed for motor 2.
Controls motor speed and direction on the A-Star 32U4 Robot Controller.
static void setM1Speed(int16_t speed)
Sets the speed for motor 1.
static void flipM1(bool flip)
Flips the direction of motor 1.
static void flipM2(bool flip)
Flips the direction of motor 2.
static void setSpeeds(int16_t m2Speed, int16_t m1Speed)
Sets the speed for both motors.