Go to Post Chiefdelphi is a great resource for all of FIRST to use over the years and has grown into a community that has taken a life of it's own. - Koko Ed [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 07-02-2009, 16:16
NewKid NewKid is offline
Registered User
AKA: Greg
FRC #1622 (Spyder)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: San Diego
Posts: 2
NewKid is an unknown quantity at this point
Clicking spike relay while on

My team and I have been trying to get the compressor programmed, but it usually clicks when the light is green switching to red for a split second before going back to normal. It does it almost randomly, and does seem to be linked to our code. We have been using a simple on/off trigger so that we can turn the relay on and off, but the clicking happens when the spike should be on. our code is:
Quote:
void compressorTest(Compressor *compr, Relay *rel)
{
static bool isOn = false;

UINT32 psvalve = compr->GetPressureSwitchValue();

if (0 == psvalve)
{
if (false == isOn)
{
isOn = true;
rel->Set(Relay::kOn);
}
}
else
{
if (true == isOn)
{
isOn = false;
rel->Set(Relay::kOff);
}
}
}
When all of the isOn {...} code is commented out, then the clicking does not happen, and it behaves correctly.

Can anyone help?
 


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
spike relay problem? Maxpower57 Electrical 15 09-04-2012 19:18
Spike relay question Zack Briggs Electrical 17 19-02-2008 14:48
Spike Relay Wire Gauge sparrowkc Electrical 7 12-02-2008 14:26
Spike Relay Input nwagers Electrical 3 16-07-2002 22:23


All times are GMT -5. The time now is 02:25.

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