I had some free time tonight and I noticed some people are having problems with relays, usually remembering to set both the corresponding FWD and REV values, so I wrote up a quick header file with commands to set relays forward, reverse or off simply by typing RELAY#_FWD or _REV or _OFF
Examples, setting Relay 1 forward
RELAY1_FWD;
Relay 1 reverse
RELAY1_REV;
Relay 1 off
RELAY1_OFF;
The semicolon is important, I designed it that way to be syntax compatible with C, some IDEs don’t like commands without semicolons
Hope this helps someone.
Simply drop in your project and add #include “relays.h” where ever you use it.
the RELAY_OFF shouldn’t be needed, but then again if you’re a noob and the easy C key you were given doesn’t work then this will work since it’s in a header file.