MakeBlock Drive Updated Updated library for MakeBlock Ranger

Loading...
Searching...
No Matches
MeDCMotor.h
Go to the documentation of this file.
1
42#ifndef MeDCMotor_H
43#define MeDCMotor_H
44
45#include <stdint.h>
46#include <stdbool.h>
47#include <Arduino.h>
48#include "MeConfig.h"
49
50#ifdef ME_PORT_DEFINED
51#include "MePort.h"
52#endif
53
59#ifndef ME_PORT_DEFINED
60 class MeDCMotor
61#else // !ME_PORT_DEFINED
62class MeDCMotor : public MePort
63#endif // !ME_PORT_DEFINED
64{
65 public:
66#ifdef ME_PORT_DEFINED
73 MeDCMotor(void);
74
80 MeDCMotor(uint8_t port);
81#else // ME_PORT_DEFINED
90 MeDCMotor(uint8_t dir_pin,uint8_t pwm_pin);
91#endif // ME_PORT_DEFINED
108 void setpin(uint8_t dir_pin,uint8_t pwm_pin);
109
124 void reset(uint8_t port);
125
142 void reset(uint8_t port, uint8_t slot);
143
158 void run(int16_t speed);
159
172 void stop(void);
173 private:
174 volatile uint8_t dc_dir_pin;
175 volatile uint8_t dc_pwm_pin;
176 int16_t last_speed;
177};
178#endif
179
MeConfig.h
Configuration file of library.
MePort.h
Header for MePort.cpp module.
MeDCMotor
Driver for Me DC motor device.
Definition MeDCMotor.h:64
MeDCMotor::reset
void reset(uint8_t port)
Definition MeDCMotor.cpp:201
MeDCMotor::run
void run(int16_t speed)
Definition MeDCMotor.cpp:243
MeDCMotor::MeDCMotor
MeDCMotor(void)
Definition MeDCMotor.cpp:53
MeDCMotor::stop
void stop(void)
Definition MeDCMotor.cpp:293
MePort
Port Mapping for RJ25.
Definition MePort.h:128