Wyatt  1.0.1
MotorAdapter.h
1 //
2 // Created by Tucker Haydon on 4/25/17.
3 //
4 
5 #pragma once
6 
7 #include "hardwareinterface/IHardwareInterface.h"
8 #include "hardwareinterface/AdafruitPWMServoHat.h"
9 #include "messages/IMessage.h"
10 #include "messages/MotorMessage.h"
11 #include <stdlib.h>
12 #include "exceptions/MismatchedMessageException.h"
13 
19 public:
20 
27  MotorAdapter(AdafruitPWMServoHat* m_pwmHat, int forwardPin, int backwardPin);
28 
32  ~MotorAdapter() override;
33 
39  void write(IMessage* msg) override;
40 
45  std::list<IMessage*>* read() override {
46  return new std::list<IMessage*>;
47  };
48 
49 private:
50  AdafruitPWMServoHat* m_pwmHat;
51  int forwardPin, backwardPin;
52 
57  void driveMotor(int speed);
58 
59 
60 };
void write(IMessage *msg) override
~MotorAdapter() override
MotorAdapter(AdafruitPWMServoHat *m_pwmHat, int forwardPin, int backwardPin)
Definition: MotorAdapter.cpp:7
std::list< IMessage * > * read() override
Definition: MotorAdapter.h:45