|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Relay Commands
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. |
|
#2
|
|||
|
|||
|
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.
|
|
#3
|
||||
|
||||
|
Re: Relay Commands
Quote:
|
|
#4
|
||||
|
||||
|
Re: Relay Commands
Quote:
|
|
#5
|
||||
|
||||
|
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.
|
|
#6
|
|||||
|
|||||
|
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; relay1_rev = 1; Code:
RELAY1_OFF; |
|
#7
|
|||||
|
|||||
|
Re: Relay Commands
Quote:
And of would be relay1_fwd=relay1_rev=0? |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Serial Commands on MPLAB | tribotec_ca88 | Programming | 2 | 24-01-2006 16:26 |
| Can anyone create new commands? | Jakenan | Programming | 5 | 22-01-2005 21:38 |
| Spike (relay) module pin out | coreyjon | Electrical | 14 | 05-04-2004 07:05 |
| Voice Activated commands | Amber H. | Technical Discussion | 40 | 03-11-2002 12:40 |
| Spike Relay Input | nwagers | Electrical | 3 | 16-07-2002 22:23 |