|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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. |
|
#3
|
|||
|
|||
|
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.
|
|
#4
|
|||
|
|||
|
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 |
|
#5
|
||||
|
||||
|
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.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |