Go to Post Since our team is in possession of the school, we have no restrictions on how late we can be there. So our teams are often practicing into the wee hours of the morning. Also, the school board uses "the breeze" for storage of high jump mats, so it's a great place to nap. :) - Karthik [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 03-02-2016, 10:24 PM
FRC3220 FRC3220 is offline
Registered User
no team
 
Join Date: Feb 2016
Location: Spangle
Posts: 11
FRC3220 is an unknown quantity at this point
Relay question

So, we've been having problems with some of our relays not working. I'm using the code that they give you for an example, because if it ain't broke, then don't fix it, right? Anyway, It seems like our relay is on (solid orange light all the time), and when I push the button to activate it in TeleOp, we hear it click, but nothing happens. Just to make sure that I'm not going insane, setting a relay to go forward, such as " example_relay.Set(Relay::kForward) " will also turn it on, right? I don't have to have an " example_relay.Set(Relay::kOn) " block nested with it, right? And for the record, it's quite possible that the issue is wiring. I just want to make sure everything is okay on my end. Here's the code, for those of you who need to see it:

Code:
bool forward = stick.GetRawButton(button2);
bool reverse = stick.GetRawButton(button3);
if (forward && reverse) {
	arm_rotator.Set(Relay::kOn); }
else if (forward == true) {         //Do I have to set it on in here, as well?
	arm_rotator.Set(Relay::kForward); } 
else if (reverse == true) {                         //And here?
        arm_rotator.Set(Relay::kReverse); }
else {
	arm_rotator.Set(Relay::kOff); }
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


All times are GMT -5. The time now is 10:24 AM.

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