MakeBlock Drive Updated Updated library for MakeBlock Ranger

Loading...
Searching...
No Matches
MeMegaPiPro4DcMotor.h
Go to the documentation of this file.
1
41#ifndef MeMegaPiPro4DcMotor_H
42#define MeMegaPiPro4DcMotor_H
43
44#include <stdint.h>
45#include <stdbool.h>
46#include <Arduino.h>
47#include "MeConfig.h"
48
49#ifdef ME_PORT_DEFINED
50#include "MePort.h"
51#endif
52
58#ifndef ME_PORT_DEFINED
59 class MeMegaPiPro4DcMotor
60#else // !ME_PORT_DEFINED
61class MeMegaPiPro4DcMotor : public MePort
62#endif // !ME_PORT_DEFINED
63{
64 public:
65#ifdef ME_PORT_DEFINED
72 MeMegaPiPro4DcMotor(void);
73
79 MeMegaPiPro4DcMotor(uint8_t port);
80#else // ME_PORT_DEFINED
89 MeMegaPiPro4DcMotor(uint8_t dir_pin,uint8_t pwm_pin);
90#endif // ME_PORT_DEFINED
107 void setpin(uint8_t dir_pin,uint8_t pwm_pin);
108
123 void reset(uint8_t port);
124
141 void reset(uint8_t port, uint8_t slot);
142
157 void run(int16_t speed);
158
171 void stop(void);
172 private:
173 volatile uint8_t dc_dir_pin;
174 volatile uint8_t dc_pwm_pin;
175 int16_t last_speed;
176};
177#endif
178
179
180
MeConfig.h
Configuration file of library.
MePort.h
Header for MePort.cpp module.
MeMegaPiPro4DcMotor
Driver for Me DC motor device.
Definition MeMegaPiPro4DcMotor.h:63
MeMegaPiPro4DcMotor::reset
void reset(uint8_t port)
Definition MeMegaPiPro4DcMotor.cpp:174
MeMegaPiPro4DcMotor::MeMegaPiPro4DcMotor
MeMegaPiPro4DcMotor(void)
Definition MeMegaPiPro4DcMotor.cpp:51
MeMegaPiPro4DcMotor::run
void run(int16_t speed)
Definition MeMegaPiPro4DcMotor.cpp:216
MeMegaPiPro4DcMotor::stop
void stop(void)
Definition MeMegaPiPro4DcMotor.cpp:264
MePort
Port Mapping for RJ25.
Definition MePort.h:128