Loom
|
Stepper actuator module. More...
#include <Stepper.h>
Public Member Functions | |
CONSTRUCTORS / DESTRUCTOR | |
Loom_Stepper (LoomManager *manager) | |
Constructor. More... | |
Loom_Stepper (LoomManager *manager, JsonArrayConst p) | |
Constructor that takes Json Array, extracts args and delegates to regular constructor. More... | |
~Loom_Stepper () | |
Destructor. More... | |
OPERATION | |
bool | dispatch (JsonObject json) override |
Route command to driver. More... | |
void | add_config (JsonObject json) override |
Add configuration information to JsonObject. More... | |
void | move_steps (const uint8_t motor, const uint16_t steps, const uint8_t speed, const bool clockwise) |
Move specified stepper specified steps, speed, and direction. More... | |
PRINT INFORMATION | |
void | print_state () const override |
Override with empty body as no state to print. More... | |
![]() | |
LoomActuator (LoomManager *manager, const char *module_name, const LoomModule::Type module_type) | |
Constructor. More... | |
virtual | ~LoomActuator ()=default |
Destructor. More... | |
virtual void | package (JsonObject json) override |
Not all actuators need a package method, implement with empty body. More... | |
![]() | |
LoomModule (LoomManager *manager, const char *module_name="Unknown", const Type module_type=Type::Unknown) | |
Constructor. More... | |
virtual | ~LoomModule ()=default |
Destructor. More... | |
virtual void | second_stage_ctor () |
Second stage construction. More... | |
virtual void | power_down () |
Turn off any hardware. More... | |
virtual void | power_up () |
Turn on any hardware. More... | |
Type | get_module_type () const |
Get module type. More... | |
LoomManager * | get_device_manager () const |
Get the device manager class if linked. More... | |
void | get_module_name (char *buf) const |
Copy module name into buffer. More... | |
const char * | get_module_name () const |
Get module name. More... | |
Verbosity | get_print_verbosity () const |
Get print verbosity. More... | |
Verbosity | get_package_verbosity () const |
Get package verbosity. More... | |
bool | get_active () const |
Get whether or not the module should be treated as active. More... | |
Category | category () const |
Get the category of the module. More... | |
virtual void | link_device_manager (LoomManager *LM) |
Add pointer back to device manager. More... | |
void | set_print_verbosity (const Verbosity v) |
Set print verbosity Controlls level of detail included in debug prints. More... | |
void | set_package_verbosity (const Verbosity v) |
Set package verbosity. More... | |
void | set_active (const bool enable) |
Set whether or not the module should be treated as active. More... | |
virtual void | print_config () const |
Display the configuration settings of the module. More... | |
Protected Attributes | |
Adafruit_MotorShield * | AFMS |
Underlying motor shield controller. More... | |
Adafruit_StepperMotor * | motors [NUM_STEPPERS] |
Array of stepper controllers. More... | |
![]() | |
const Type | module_type |
Module type. More... | |
LoomManager * | device_manager |
Pointer to manager. More... | |
const String | module_name_base |
The name of the module (Should have a DEFAULT but can be overriden if provided to constructor) More... | |
const char * | module_name |
bool | active |
Whether or not the module should be treated as active. More... | |
Verbosity | print_verbosity |
Print verbosity. More... | |
Verbosity | package_verbosity |
Package verbosity. More... | |
Stepper actuator module.
Loom_Stepper::Loom_Stepper | ( | LoomManager * | manager | ) |
Constructor.
Loom_Stepper::Loom_Stepper | ( | LoomManager * | manager, |
JsonArrayConst | p | ||
) |
Constructor that takes Json Array, extracts args and delegates to regular constructor.
[in] | p | The array of constuctor args to expand |
Loom_Stepper::~Loom_Stepper | ( | ) |
Destructor.
|
overridevirtual |
Add configuration information to JsonObject.
LoomManager iterates over modules to build complete configuration
[in] | json | Json configuration object to add to |
Reimplemented from LoomModule.
|
overridevirtual |
Route command to driver.
Reimplemented from LoomModule.
void Loom_Stepper::move_steps | ( | const uint8_t | motor, |
const uint16_t | steps, | ||
const uint8_t | speed, | ||
const bool | clockwise | ||
) |
Move specified stepper specified steps, speed, and direction.
[in] | motor | Which stepper to move (0-3) |
[in] | steps | Number of steps to rotate |
[in] | speed | Speed to move at (0-255) |
[in] | clockwise | True to rotate clockwise, false for counterclock-wise |
|
inlineoverridevirtual |
Override with empty body as no state to print.
Reimplemented from LoomModule.
|
protected |
Underlying motor shield controller.
|
protected |
Array of stepper controllers.