diff options
| author | EnricoGuccii <partyka.003@gmail.com> | 2025-05-11 19:11:37 +0200 |
|---|---|---|
| committer | EnricoGuccii <partyka.003@gmail.com> | 2025-05-11 19:11:37 +0200 |
| commit | f3a5b90d090fda687adad44e37200fa446fcf7e0 (patch) | |
| tree | b7c432c13d4427cc2622c9b149522a97db55b302 /lib/motors/motors.h | |
| parent | cf9a1f07ed519cadd58e38794616d0a9596be4ae (diff) | |
add motors
Diffstat (limited to 'lib/motors/motors.h')
| -rw-r--r-- | lib/motors/motors.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/motors/motors.h b/lib/motors/motors.h new file mode 100644 index 0000000..bcba09c --- /dev/null +++ b/lib/motors/motors.h @@ -0,0 +1,29 @@ +#include <Arduino.h> +#include "settings.h" + +#pragma once + +class MOTORS +{ +public: + MOTORS(); + void init(); + + void forward(int speed, int duration = 0); + void backward(int speed, int duration = 0); + + void leftForward(int speed, int duration = 0); + void leftBackward(int speed, int duration = 0); + void rightForward(int speed, int duration = 0); + void rightBackward(int speed, int duration = 0); + + void leftTurn(int speed, int duration = 0); + void rightTurn(int speed, int duration = 0); + + void leftStop(); + void rightStop(); + void stop(); + +private: + int scaleSpeed(int speed); +};
\ No newline at end of file |