![]() |
Relay Commands
1 Attachment(s)
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 Code:
RELAY1_FWD;Code:
RELAY1_REV;Code:
RELAY1_OFF;Hope this helps someone. Simply drop in your project and add #include "relays.h" where ever you use it. |
Re: Relay Commands
I forgot to set the reverse to 0 when I first tried. Once you know how it works, getting it to work is not a problem.
|
Re: Relay Commands
Quote:
|
Re: Relay Commands
Quote:
|
Re: Relay Commands
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.
|
Re: Relay Commands
Good job. I wouldn't limit the usage of this to "C noobs" either. Everyone can benefit from the readability change from
Code:
relay1_fwd = 0;Code:
RELAY1_OFF; |
Re: Relay Commands
Quote:
And of would be relay1_fwd=relay1_rev=0? |
| All times are GMT -5. The time now is 08:44. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi