Go to Post I have way too much time on my hands. - Brandon Martus [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-02-2006, 20:49
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
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;
Relay 1 reverse
Code:
RELAY1_REV;
Relay 1 off
Code:
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.
Attached Files
File Type: h relays.h (1.3 KB, 80 views)
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)
  #2   Spotlight this post!  
Unread 17-02-2006, 22:08
X-Istence X-Istence is offline
Melt the RC controller!
AKA: Bert JW Regeer
no team
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Montville
Posts: 151
X-Istence will become famous soon enoughX-Istence will become famous soon enough
Send a message via AIM to X-Istence Send a message via MSN to X-Istence
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.
__________________
My Blog!
  #3   Spotlight this post!  
Unread 18-02-2006, 01:01
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
Re: Relay Commands

Quote:
Originally Posted by X-Istence
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.
I wrote it to make programming a little simpler, nobody is saying you have to use it or not use it, it's out there if you wish to.
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)
  #4   Spotlight this post!  
Unread 18-02-2006, 15:04
lil_longo's Avatar
lil_longo lil_longo is offline
Registered User
AKA: Brian
FRC #1676
Team Role: Mascot
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Pascack Valley
Posts: 53
lil_longo has a spectacular aura aboutlil_longo has a spectacular aura aboutlil_longo has a spectacular aura about
Send a message via AIM to lil_longo
Re: Relay Commands

Quote:
Originally Posted by X-Istence
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.
i no me too
  #5   Spotlight this post!  
Unread 18-02-2006, 18:00
Anime-niac_2.9's Avatar
Anime-niac_2.9 Anime-niac_2.9 is offline
Japanese-crap freak(NOTE AVATAR)
AKA: Alex Abenoja, A-Squared, & Anime
FRC #0599 (Robodox)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Northridge, California
Posts: 88
Anime-niac_2.9 will become famous soon enough
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.
__________________
THE ROBODOX FORUM

Reading: Suzumiya Haruhi no Yuutsu by Tanigawa Nagaru
Religion: Haruhiism
  #6   Spotlight this post!  
Unread 18-02-2006, 18:32
Mike's Avatar
Mike Mike is offline
has common ground with Matt Krass
AKA: Mike Sorrenti
FRC #0237 (Sie-H2O-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: Watertown, CT
Posts: 1,003
Mike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond repute
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;
to
Code:
RELAY1_OFF;
__________________
http://www.mikesorrenti.com/
  #7   Spotlight this post!  
Unread 18-02-2006, 23:03
DanDon's Avatar
DanDon DanDon is offline
ohhh MY god
AKA: Dan Hoizner
FRC #0375 (The Robotic Plague)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Staten Island, NY
Posts: 1,432
DanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond repute
Send a message via ICQ to DanDon Send a message via AIM to DanDon Send a message via MSN to DanDon
Re: Relay Commands

Quote:
Originally Posted by Mike
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;
to
Code:
RELAY1_OFF;
Hey Mike, wouldn't that be RELAY1_REV?
And of would be relay1_fwd=relay1_rev=0?
__________________
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 20:06.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi