#define module_driver #include "stepdance.hpp" // -- Define Input Ports -- InputPort input_a; // Input from Main Board // -- Define Output Ports / Channels -- OutputPort output_a; OutputPort output_b; OutputPort output_c; OutputPort output_d; Channel channel_w; Channel channel_x; Channel channel_y; Channel channel_z; void setup() { // -- Configure and start the output ports -- output_a.begin(OUTPUT_A); output_b.begin(OUTPUT_B); output_c.begin(OUTPUT_C); output_d.begin(OUTPUT_D); // -- Enable the output drivers -- enable_drivers(); // -- Configure and start the LOCAL channels -- channel_w.begin(&output_a, SIGNAL_E); channel_w.set_ratio(1, 1); channel_x.begin(&output_b, SIGNAL_E); channel_x.set_ratio(1, 1); channel_y.begin(&output_c, SIGNAL_E); channel_y.set_ratio(1, 1); channel_z.begin(&output_d, SIGNAL_E); channel_z.set_ratio(1, 1); // -- Configure and start the INPUT port -- input_a.begin(INPUT_A); // -- Map INPUT SIGNALS to LOCAL CHANNELS -- // Map incoming X signal (2us) input_a.output_x.map(&channel_w.input_target_position); // Map incoming Y signal (3us) input_a.output_y.map(&channel_x.input_target_position); // Map incoming Z signal (6us) input_a.output_z.map(&channel_y.input_target_position); // Map incoming E signal (7us) input_a.output_e.map(&channel_z.input_target_position); dance_start(); } void loop() { dance_loop(); }