Roboid Control for C++
Loading...
Searching...
No Matches
DRV8833.h
1#pragma once
2
3#include "Thing.h"
4#include "Things/DifferentialDrive.h"
5
6namespace RoboidControl {
7namespace Arduino {
8
10class DRV8833Motor : public Thing {
11 public:
13 enum class RotationDirection { Clockwise = 1, CounterClockwise = -1 };
14
19 DRV8833Motor(Participant* participant, unsigned char pinIn1, unsigned char pinIn2, bool reverse = false);
20 void SetMaxRPM(unsigned int rpm);
21
22 virtual void SetAngularVelocity(Spherical velocity) override;
23
24 bool reverse = false;
25
26 protected:
27 unsigned char pinIn1 = 255;
28 unsigned char pinIn2 = 255;
29 unsigned int maxRpm = 200;
30};
31
32class DRV8833 : public Thing {
33 public:
43 DRV8833(Participant* participant,
44 unsigned char pinAIn1,
45 unsigned char pinAIn2,
46 unsigned char pinBIn1,
47 unsigned char pinBIn2,
48 unsigned char pinStandby = 255,
49 bool reverseA = false,
50 bool reverseB = false);
51
52 DRV8833Motor* motorA = nullptr;
53 DRV8833Motor* motorB = nullptr;
54
55 protected:
56 unsigned char pinStandby = 255;
57};
58
59} // namespace Arduino
60} // namespace RoboidControl
Support for a DRV8833 motor controller.
Definition DRV8833.h:10
RotationDirection
Motor turning direction.
Definition DRV8833.h:13
virtual void SetAngularVelocity(Spherical velocity) override
Set the angular velocity of the thing.
Definition DRV8833.cpp:32
A participant is a device which manages things. It can communicate with other participant to synchron...
Definition Participant.h:14
A thing is the primitive building block.
Definition Thing.h:20