Main Page
Namespaces
Namespace List
Namespace Members
All
Variables
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
~
Functions
a
b
c
d
e
g
i
j
l
m
n
o
p
r
s
t
u
w
~
Variables
a
c
d
e
f
g
h
i
j
k
l
m
n
o
p
s
t
u
v
w
Typedefs
Files
File List
File Members
All
a
b
c
e
k
l
m
n
p
r
s
t
u
Functions
Variables
Typedefs
Macros
scripts
base_controller
lib
motor_controllers
adafruit_feather_wing
adafruit_feather_wing.h
Go to the documentation of this file.
1
/*
2
* Author: Franz Pucher
3
*/
4
5
#ifndef ADAFRUIT_MOTOR_CONTROLLER_H
6
#define ADAFRUIT_MOTOR_CONTROLLER_H
7
8
// The special bit of code in this example is the use of Arduino's Wire library.
9
// Wire is a I2C library that simplifies reading and writing to the I2C bus.
10
#include <Wire.h>
11
#include <Adafruit_MotorShield.h>
12
13
#include "
diffbot_base_config.h
"
14
15
#include <
motor_controller_interface.h
>
16
17
namespace
diffbot
{
18
28
class
AdafruitMotorController
:
public
MotorControllerIntf
<Adafruit_MotorShield>
29
{
30
public
:
41
AdafruitMotorController
(uint8_t motor_num, uint8_t addr=0x60);
42
49
void
begin
(uint16_t freq = 1600);
50
68
void
setSpeed
(
int
value)
override
;
69
70
71
private
:
72
// Pointer to the motor that is controlled by this motor controller.
73
Adafruit_DCMotor *
pMotor_
;
74
};
75
76
}
77
78
#endif // ADAFRUIT_MOTOR_CONTROLLER_H
diffbot_base_config.h
diffbot
Definition:
base_controller.h:23
diffbot::AdafruitMotorController::pMotor_
Adafruit_DCMotor * pMotor_
Definition:
adafruit_feather_wing.h:73
diffbot::AdafruitMotorController::setSpeed
void setSpeed(int value) override
Set the speed of the motor pMotor_.
Definition:
adafruit_feather_wing.cpp:16
diffbot::AdafruitMotorController
Implementation of the MotorControllerIntf for the Adafruit_MotorShield.
Definition:
adafruit_feather_wing.h:28
motor_controller_interface.h
diffbot::AdafruitMotorController::AdafruitMotorController
AdafruitMotorController(uint8_t motor_num, uint8_t addr=0x60)
Construct an AdafruitMotorController for a single motor.
Definition:
adafruit_feather_wing.cpp:4
diffbot::MotorControllerIntf
Abstract base interface class for a motor controller.
Definition:
motor_controller_interface.h:17
diffbot::AdafruitMotorController::begin
void begin(uint16_t freq=1600)
Initializes the communication with the motor driver.
Definition:
adafruit_feather_wing.cpp:11
diffbot_base
Author(s):
autogenerated on Thu Sep 7 2023 02:35:23