26 lines
425 B
C++
26 lines
425 B
C++
#ifndef COMPLIB_SERVER_MOTORS_HPP
|
|
#define COMPLIB_SERVER_MOTORS_HPP
|
|
|
|
#include <cstdint>
|
|
|
|
class Motors {
|
|
public:
|
|
enum Mode : uint8_t {
|
|
COAST = 0,
|
|
FORWARD = 1,
|
|
BACKWARD = 2,
|
|
BREAK = 3,
|
|
SERVO = 4,
|
|
NONE = 5
|
|
};
|
|
|
|
static void set_power(uint8_t port, double percent);
|
|
|
|
static void set_pwm(uint8_t port, uint16_t pwm, Mode mode);
|
|
|
|
private:
|
|
|
|
Motors() = default;
|
|
};
|
|
|
|
#endif //COMPLIB_SERVER_MOTORS_HPP
|