RoboidControl for Arduino
Loading...
Searching...
No Matches
TB6612.h
Go to the documentation of this file.
1#pragma once
2
3#include <Arduino.h>
4#include "Motor.h"
5
6namespace Passer {
7namespace RoboidControl {
8
10class TB6612Motor : public Motor {
11 public:
13 byte pinIn1;
15 byte pinIn2;
17 byte pinPWM;
18
29 TB6612Motor(byte pinIn1, byte pinIn2);
30
39 TB6612Motor(byte pinIn1, byte pinIn2, byte pinPWM);
40
42 // enum Direction { Forward = 1,
43 // Reverse = -1 };
44
46 // void SetDirection(Direction direction);
47
48 void SetSpeed(float speed);
49};
50
52class TB6612 {
53 public:
55 TB6612();
56
58 warning("\n- Note that without PWM, the speed of the motor cannot be "
59 "controlled.\n- Make sure the standby pin is pulled high.\n")))
69 TB6612(byte pinAIn1, byte pinAIn2, byte pinBIn1, byte pinBIn2);
70 TB6612(byte pinAIn1,
71 byte pinAIn2,
72 byte pinPWMA,
73 byte pinBIn1,
74 byte pinBIn2,
75 byte pinPWMB);
76 TB6612(byte pinAIn1,
77 byte pinAIn2,
78 byte pinPWMA,
79 byte pinBIn1,
80 byte pinBIn2,
81 byte pinPWMB,
82 byte pinStandby);
83
86
88};
89
90} // namespace RoboidControl
91} // namespace Passer
92using namespace Passer::RoboidControl;
A Motor is a Thing which can move parts of the Roboid.
Definition Motor.h:11
A TB6612 motor controller.
Definition TB6612.h:52
TB6612Motor motorB
Definition TB6612.h:85
__attribute__((warning("\n- Note that without PWM, the speed of the motor cannot be " "controlled.\n- Make sure the standby pin is pulled high.\n"))) TB6612(byte pinAIn1
Create a TB6612 motor driver controller using only directional control.
TB6612Motor motorA
Definition TB6612.h:84
byte byte byte pinBIn2
Definition TB6612.h:69
byte pinStandby
Definition TB6612.h:87
byte pinAIn2
Definition TB6612.h:69
byte byte pinBIn1
Definition TB6612.h:69
TB6612()
Create an default TB6612 motor driver controller.
Definition TB6612.cpp:32
A single port of the TB6612 motor controller.
Definition TB6612.h:10
byte pinIn1
The pin number for the in1 signal.
Definition TB6612.h:13
byte pinIn2
The pin number for the in2 signal.
Definition TB6612.h:15
byte pinPWM
The pin for the PWM speed signal.
Definition TB6612.h:17
TB6612Motor()
Definition TB6612.cpp:3
void SetSpeed(float speed)
Turning direction of the motor.
Definition TB6612.cpp:23
Definition DRV8833.h:6