-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDynamic_control.h
More file actions
24 lines (24 loc) · 1.05 KB
/
Dynamic_control.h
File metadata and controls
24 lines (24 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
Dynamic_control.h - заголовочный файл класса для управления
двумя двигателями с через функции задания скорости и направления вращения
Created by Smirnov Artem, September 3, 2014.
*/
#ifndef Dynamic_control_h
#define Dynamic_control_h
#include <Arduino.h>
class Dynamic_control
{
public:
Dynamic_control(Motor M1, Motor M2);
void dSmoothRun(bool direction, int lSpeed, int rSpeed); //моторы вращаются в одном направлении
void dReversal(bool direction, int lSpeed, int rSpeed); //моторы вращаются в одном направлении
void dSmoothStop(int delay); //плавная остановка (доступна при использовании класса Dynamic_control)
//delay - задержка в цикле в милисекундах (чем больше, тем медленнее)
private:
void _dSmooth(int lSpeed, int rSpeed, int delay);
Motor _M1;
Motor _M2;
int _lSpeed;
int _rSpeed;
};
#endif