InputPort components receive motion streams on physical Stepdance input ports, and map these signals to downstream components.
More...
#include <input_ports.hpp>
|
| | InputPort () |
| | Default constructor for InputPort.
|
| void | begin (uint8_t port_number) |
| | Initialize the InputPort with a port number corresponding to the target physical port on the Stepdance Board.
|
|
void | enable_all_signals () |
| | Enables all input signals (SIGNAL_X, SIGNAL_Y, SIGNAL_Z, SIGNAL_E, SIGNAL_R, SIGNAL_T). Signals are enabled by default.
|
|
void | disable_all_signals () |
| | Disables all input signals (SIGNAL_X, SIGNAL_Y, SIGNAL_Z, SIGNAL_E, SIGNAL_R, SIGNAL_T).
|
| void | enable_signal (uint8_t signal_index) |
| | Enables a specific input signal.
|
| void | disable_signal (uint8_t signal_index) |
| | Disables a specific input signal.
|
| void | set_ratio (float output_units, float input_units=1.0) |
| | Sets the ratio between input units and output units for all input signals. Default is 1:1.
|
InputPort components receive motion streams on physical Stepdance input ports, and map these signals to downstream components.
Receiving and decoding of input streams occurs asynchronously. Here's an example of how to instantiate and configure an InputPort and map it to an OutputPort:
#define module_driver
#include "stepdance.hpp"
void setup() {
input_a.
output_z.
map(&channel_z.input_target_position);
}
void loop(){
dance_loop();
}
◆ InputPort()
Default constructor for InputPort.
Initializes an InputPort instance with default, unconfigured state. This does not configure hardware or register the port; call begin() to initialize hardware-specific settings and register the port with the system.
◆ begin()
| void InputPort::begin |
( |
uint8_t | port_number | ) |
|
Initialize the InputPort with a port number corresponding to the target physical port on the Stepdance Board.
- Parameters
-
| port_number | Index of the physical input port (INPUT_A for all Basic Modules and INPUT_A through INPUT_D for Machine Controllers). |
◆ disable_signal()
| void InputPort::disable_signal |
( |
uint8_t | signal_index | ) |
|
Disables a specific input signal.
- Parameters
-
| signal_index | Index of the signal to disable (SIGNAL_X, SIGNAL_Y, SIGNAL_Z, SIGNAL_E, SIGNAL_R, SIGNAL_T). |
◆ enable_signal()
| void InputPort::enable_signal |
( |
uint8_t | signal_index | ) |
|
Enables a specific input signal.
- Parameters
-
| signal_index | Index of the signal to enable (SIGNAL_X, SIGNAL_Y, SIGNAL_Z, SIGNAL_E, SIGNAL_R, SIGNAL_T). |
◆ set_ratio()
| void InputPort::set_ratio |
( |
float | output_units, |
|
|
float | input_units = 1.0 ) |
Sets the ratio between input units and output units for all input signals. Default is 1:1.
- Parameters
-
| output_units | Number of world units per input unit. |
| input_units | Number of input units. Default is 1. |
◆ output_x
BlockPort that acts as output for the SIGNAL_X input.
void map(BlockPort *map_target, uint8_t mode)
Maps this BlockPort to a target BlockPort with a specified mode (INCREMENTAL or ABSOLUTE).
The documentation for this class was generated from the following file: