The STEAM Org Robotics Kit  v1
Motor.h
1 #ifndef MOTOR_H
2 #define MOTOR_H
3 
4 #include "Arduino.h"
5 
12 class Motor {
13 public:
20  Motor(u_int8_t enb, u_int8_t switch1, u_int8_t switch2,
21  bool reversed = false);
22 
33  void setSpeed(int speed);
34 
38  void stop();
39 
40 private:
41  bool _reversed;
42  u_int8_t _enb;
43  u_int8_t _switch1;
44  u_int8_t _switch2;
45 };
46 
47 #endif
This allows for control of a motor through a L298N module A great explainer on how the l298N module w...
Definition: Motor.h:12
void stop()
Stops the motor by turning off both switches in the H-Bridge.
Definition: Motor.cpp:40
void setSpeed(int speed)
Sets the speed of the motor.
Definition: Motor.cpp:13
Motor(u_int8_t enb, u_int8_t switch1, u_int8_t switch2, bool reversed=false)
Definition: Motor.cpp:3