Loom_Servo class

Servo actuator module.

Base classes

class LoomActuator
Abstract base class of actuator modules.

Protected variables

Adafruit_PWMServoDriver servo_driver
Underlying servo driver instance.
uint8_t positions
Positions of the servos.

CONSTRUCTORS / DESTRUCTOR

Loom_Servo(LoomManager* manager)
Constructor.
Loom_Servo(LoomManager* manager, JsonArrayConst p)
Constructor that takes Json Array, extracts args and delegates to regular constructor.
~Loom_Servo() defaulted
Destructor.

OPERATION

void package(JsonObject json) override
Not all actuators need a package method, implement with empty body.
auto dispatch(JsonObject json) -> bool override
Route command to driver.
void add_config(JsonObject json) override
Add configuration information to JsonObject.
void set_degree(const uint8_t servo, const uint8_t degree)
Set servo position.

Function documentation

Loom_Servo::Loom_Servo(LoomManager* manager, JsonArrayConst p)

Constructor that takes Json Array, extracts args and delegates to regular constructor.

Parameters
manager
in The array of constuctor args to expand

void Loom_Servo::add_config(JsonObject json) override

Add configuration information to JsonObject.

Parameters
json in Json configuration object to add to

LoomManager iterates over modules to build complete configuration

void Loom_Servo::set_degree(const uint8_t servo, const uint8_t degree)

Set servo position.

Parameters
servo in The servo number to control
degree in The position to set the servo to