Hi all,
I have absolutely no idea what is causing this problem, so I just decided to post in this section of the forum. Before the season started, I started doing simple things like getting led’s to blink (this is our first year using java). I used image 28 and whatever netbeans plugin version at that time. I got plenty of things working (putting it all in the robotinit() section in the iterative template). Anyway, I have been trying to get some relays and solenoids to work, but nothing worked, so I threw away all of those programs. Just now it occurred to me that nothing has been working since I updated the cRio and Netbeans plugins. The programs still get uploaded. Netbeans says so. But nothing works. Some other things I have noticed: All Digital outputs are at 5v (even though they were not referenced in the code). Also, they solenoids go 1v-0v-1v-0v at 1 second intervals.
Don’t worry, I understand the new way of referencing slots, and have updated my code accordingly. Here is an example:
package edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.*;
public class RobotTemplate extends IterativeRobot {
Relay twoWay = new Relay(1,1)
public void robotInit() {
twoWay.set(Relay.Value.kForward);
}}
with the digital module in slot 2. Also, when I reimaged the cRio, I had to format it with labview and the new image, and then go back and change it to java.
Putting “everything” in robotInit is a bit strange and probably not what you want to do. The robot outputs (PWM and relays) will not be enabled unless the robot is enabled. Which means that your code to set those outputs should probably be in one of the teleop or autonomous methods.
If i’m not mistaken these are the methods that are currently running, and if (yet again) i’m not mistaken one of those used to be IterativeRobot.robotInit().
When I get back to the lab I’ll upload the same code but in the disabledInit() instead of robotInit().
robotInit should always be called first (right after your constructor). Those messages indicate that those methods are running (they should be) and that you haven’t put anything in them. If you override those methods with your own code they will go away.
You need to enable your robot using the Driver’s Station software.
if it plugged into the digital sidecar, check the ribbon cable is made properly. (if this was the problem with our sidecar (we havn’t retested it yet) then if the solenoid is supposed to be in PWM slot 1, put it in slot 3 and try, at the least this was a problem we seemed to have…