![]() |
Relay Trouble
We are having a problem using a Relay object. Whenever we add a relay to our C++ code the drivers station indicates No Robot Code. We have used victors, digital inputs and solenoids with no problem but add a relay and no code. We have imaged the cRIO with the 2011 image, have updated Windriver and are using the 2011 WPILib. We've even tried a second cRIO, digital module and sidecar.
Does anyone know what could be causing this? |
Re: Relay Trouble
Quote:
|
Re: Relay Trouble
Right now the code to define a relay looks like this:
Relay *abcRelay; abcRelay = new Relay(3); The first line is globally defined and the second line is in a function called Init_Controls which is called from IRobot which is the constructor for the IterativeRobot class. Until I just checked the code, I was thinking that Init_Controls was called from RobotInit so this might be part of the problem but digital_inputs and solenoids are defined in the same function and work fine. It is the addition of the second line that kills the code. |
Re: Relay Trouble
Quote:
Edit: I would recommend placing the assignment in your constructor. |
Re: Relay Trouble
Well I got to thinking about this problem and why we see it and nobody else does. We didn't have much code in the project we were using so I decided to delete it and start over. I carefully followed the instructions to add the example project FRC Default Program and that worked. I then added a relay and that also worked so I modified the project like before and everything is working. I thought we had done this a couple of days ago but apparently not.
I'm sorry I didn't think to try this before I posted but I'm glad it's working so we can move on. Thanks for your comments. |
| All times are GMT -5. The time now is 13:56. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi