Go to Post Remember that the 4-slot cRIO...only has 4 slots. :) - Alan Anderson [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

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 15-07-2009, 22:10
Happyisgood Happyisgood is offline
Registered User
FRC #3161 (Tronic Titans)
Team Role: College Student
 
Join Date: May 2009
Rookie Year: 2009
Location: Canada
Posts: 23
Happyisgood is an unknown quantity at this point
Re: C++ Relay Code?

Ok, I will have another 5 hours or so with the Robot tomorrow, so I'll try getting it up and running then. I actually have a feeling that its a problem with my relay declaration, the reason I'm thinking this is because when I move the line

hRelay->Set(Relay::kForward);

to the TeleopPeriodic() function (essentially eliminating the need to press the trigger) the relay still remains inactive (however it is initialized I believe, the light is not flashing but solid orangeyred.)

What could cause this? Is there a limit on the number of variables etc. that can be declared in the robot? Anyway, once I'm back with the robot tomorrow I'll comment out mostly all of the code until it gets working, then slowly re-intigrate aspects of the code until it stops working and troubleshoot from there. If the schools internet is up I'll keep this updated, if its not I'll post an update tomorrow night. I need this working by Friday night so I really hope this can be resolved quickly
__________________
2009 - Waterloo Regional - Regional Finalist
2009 - Waterloo Regional - Engineering Inspiration Award


________________________

2009 Team Member 1334
Reply With Quote
  #2   Spotlight this post!  
Unread 15-07-2009, 22:23
Dave Scheck's Avatar
Dave Scheck Dave Scheck is offline
Registered User
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Feb 2003
Rookie Year: 2002
Location: Arlington Heights, IL
Posts: 574
Dave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond repute
Re: C++ Relay Code?

FYI relays are solid orange whether or not they have a signal so that's not really a good indication. It just means you're getting power.

Your approach seems like a good plan about backing things out and reintegrating. Maybe before you do that, throw some prints into the periodic function to make sure it's being called properly. If it isn't then you may be chasing a ghost.
Reply With Quote
  #3   Spotlight this post!  
Unread 16-07-2009, 08:27
Happyisgood Happyisgood is offline
Registered User
FRC #3161 (Tronic Titans)
Team Role: College Student
 
Join Date: May 2009
Rookie Year: 2009
Location: Canada
Posts: 23
Happyisgood is an unknown quantity at this point
Re: C++ Relay Code?

Yeah, I realize that, I'll try to figure out how to use printf's in robot code. I never have before because usually my code works (or comes very close to working) and I've never had a need.
__________________
2009 - Waterloo Regional - Regional Finalist
2009 - Waterloo Regional - Engineering Inspiration Award


________________________

2009 Team Member 1334
Reply With Quote
  #4   Spotlight this post!  
Unread 16-07-2009, 13:12
Happyisgood Happyisgood is offline
Registered User
FRC #3161 (Tronic Titans)
Team Role: College Student
 
Join Date: May 2009
Rookie Year: 2009
Location: Canada
Posts: 23
Happyisgood is an unknown quantity at this point
Re: C++ Relay Code?

Problem solved.

After about an hour of work I got desperate and started looking in the most obscure places. I then realized what was wrong. We have two projects on the laptop, both nearly identical, they both actually do the exact same thing for the robot. The only difference is that one is uploaded and the other is not. I was editing/building the one that IS NOT uploading, and was constantly re-loading the one that was never changed. My initial code (see post 1) worked when put into the RIGHT project.

Time to have some fun and add in a custom dashboard!

Thanks everyone for the help!
Nick
__________________
2009 - Waterloo Regional - Regional Finalist
2009 - Waterloo Regional - Engineering Inspiration Award


________________________

2009 Team Member 1334
Reply With Quote
  #5   Spotlight this post!  
Unread 16-07-2009, 14:54
Dave Scheck's Avatar
Dave Scheck Dave Scheck is offline
Registered User
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Feb 2003
Rookie Year: 2002
Location: Arlington Heights, IL
Posts: 574
Dave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond repute
Re: C++ Relay Code?

Glad to hear that it worked. Your comments about the dashboard reminded me that I wanted to publish our dashboard framework. It sat on top of the WPILib interface and made things really easy to interface with. I need to clean it up a bit to make it less intimidating to read (we had over 100 pieces of data that we were sending to the dashboard). Look for something in the next day or so.
Reply With Quote
Reply


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
Relay (Spike) elbuo Electrical 2 09-02-2009 20:36
Relay Problems starsROBOTICS NI LabVIEW 2 30-01-2009 23:40
Instance relay Team_486 Programming 0 28-03-2007 09:56
Intermittent CODE ERROR, followed by uncommanded relay switching tcj103 Programming 4 22-01-2007 02:59
Relay outputs on rc jdawson Electrical 4 26-01-2003 12:51


All times are GMT -5. The time now is 14:16.

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