Stepdance Software Library
Loading...
Searching...
No Matches
OutputPort Class Reference

OutputPorts are modules that convert internal step commands into a frame of pulse signals on the physical output port on the machine controller module or basic module. More...

#include <output_ports.hpp>

Inheritance diagram for OutputPort:

Public Member Functions

 OutputPort ()
 Default constructor for OutputPort. Initializes an OutputPort 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.
void begin (uint8_t port_number)
 Initialize the OutputPort with a port number corresponding to the target physical port on the Stepdance Board.

Detailed Description

OutputPorts are modules that convert internal step commands into a frame of pulse signals on the physical output port on the machine controller module or basic module.

Output ports contain step and direction signal flags for each of the six output signal types (X, Y, Z, E, R, and T). Here's an example of how to instantiate and configure an OutputPort:

#define module_driver
#include "stepdance.hpp"
OutputPort output_a;
Channel channel_a;
void setup() {
// -- Configure and start the output port --
output_a.begin(OUTPUT_A); // "OUTPUT_A" specifies the physical port on the PCB for the output.
// -- Configure and start the channels --
channel_a.begin(&output_a, SIGNAL_E); // Connects the channel to the "E" signal on "output_a".
// We choose the "E" signal because it results in a step pulse of 7us,
// which is more than long enough for the driver IC
channel_a.set_ratio(40, 3200); // Sets the input/output transmission ratio for the channel.
}
void loop(){
dance_loop();
}

Member Function Documentation

◆ begin()

void OutputPort::begin ( uint8_t port_number)

Initialize the OutputPort with a port number corresponding to the target physical port on the Stepdance Board.

Parameters
port_numberIndex of the physical output port (OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D).

The documentation for this class was generated from the following file: