Go to Post Lawyers find loopholes. Engineers find solutions. For which would you rather be known? - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 18-02-2010, 16:42
Mr. Stone Mr. Stone is offline
Registered User
FRC #1622 (Spyder)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2009
Location: California
Posts: 5
Mr. Stone is an unknown quantity at this point
Spike Relay works only in Reverse

Hi,
We want a button to start the relay in reverse, and one for it to go forward. We also have a button to make it stop. The problem is that the spike is only getting the signals to send it in reverse and to stop.

our code for it is as follows:
Code:
// We need to decide what buttons belong to which functions.
			AvoidTipOver(joyBtnShooter7Pushed,
						 joyBtnShooter8Pushed,
						 joyBtnShooter9Pushed,
						 joyBtnShooter5Pushed);
//these are all configured properly, at one point, we were using this for our pneumatics




void AvoidTipOver(bool btn7,
					  bool btn8,
					  bool btn9,
					  bool btn5)
	{
		// tells the tipBarLeft/Right to be able to work both directions, but it does not seem to
		// be working at the moment, tweak this to make it work better.  
		tipBarLeft->SetDirection(Relay::kBothDirections);
		tipBarRight->SetDirection(Relay::kBothDirections);

		
		if (btn8)
		{
			tipBarLeft->Set(Relay::kForward);//when btn8 is pressed we want it to be set in the forward position.  
		}
		if (btn9)
		{
			tipBarLeft->Set(Relay::kReverse);//when btn9 is pressed we want it to be set in the reverse position.
		}
		if (btn5)
		{
			tipBarLeft->Set(Relay::kOff);//when btn 5 is pressed we want it to stop.  
			
		}
	}




		tipBarLeft = new Relay(TipBarLeft);
		tipBarRight = new Relay(TipBarRight);//not used at the moment, we are just testing on a mock-up board.  
		tipBarLeft->Set(Relay::kOff);
		tipBarRight->Set(Relay::kOff);
The relay is on channel 1 and is getting power. When we press button 9, it goes in reverse. When we press button 5, it stops. When we press button 8, it stays in the off position.


thanks,
Mr. Stone
Reply With Quote
 


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
Relay bug, doesn't work in Forward or Reverse only modes Joe Ross NI LabVIEW 0 16-02-2010 23:33
Relay (Spike) elbuo Electrical 2 09-02-2009 20:36
Making a forward only speed control reverse sanddrag Electrical 7 12-12-2003 07:19
Spike Relay Input nwagers Electrical 3 16-07-2002 22:23


All times are GMT -5. The time now is 15:21.

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