25 lines
585 B
C++
25 lines
585 B
C++
#pragma once
|
|
|
|
#include "Thing.h"
|
|
|
|
namespace RoboidControl {
|
|
|
|
class Motor : public Thing {
|
|
public:
|
|
Motor(Thing* parent = Thing::LocalRoot());
|
|
|
|
/// @brief Motor turning direction
|
|
enum class Direction { Clockwise = 1, CounterClockwise = -1 };
|
|
/// @brief The forward turning direction of the motor
|
|
Direction direction;
|
|
|
|
virtual void SetTargetVelocity(float velocity); // -1..0..1
|
|
|
|
int GenerateBinary(char* bytes, unsigned char* ix) override;
|
|
// virtual void ProcessBinary(char* bytes) override;
|
|
|
|
//protected:
|
|
float targetVelocity = 0;
|
|
};
|
|
|
|
} // namespace RoboidControl
|