Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
#ifndef TRIGGER_UTILS_H
#define TRIGGER_UTILS_H
#include "State.h"
#include <Arduino.h>
class TriggerUtils {
public:
static void setAllOutputsLow() {
for (int i = 0; i < numChannels; i++) {
digitalWrite(outputPins[i], LOW);
}
}
static void setOutput(uint8_t channel, bool state) {
if (channel < numChannels) {
digitalWrite(outputPins[channel], state ? HIGH : LOW);
}
}
static void handleStepOverflow(uint8_t &stepCount, uint8_t maxSteps) {
if (stepCount >= maxSteps) {
stepCount = 0;
}
}
static void applyDelay(int8_t msDelay) {
if (msDelay > 0) {
delay(msDelay);
} else if (msDelay < 0) {
delay(msDelay * -1);
}
}
};
#endif
aee3df570This file is pinned to the selected release. Download the original to open it in your design tool.