More coding assistance

Everyone has been amazing with assistance. We are so thankful. I could use some more help with more programming. We run a timed robot java code with sparkmax motor controllers. We have an arm that will have air pushing it up, and air to pinch. We have a cylinder with a double solenoid that can do this, in theory. I basically need somebody to walk me through this step by step because we are out of time. We have the compressor coded, and some of the solenoid, I believe. Here are pics of what we have built so far. We will also need help coding for two controllers. One to drive, and one to work with the arm. The drive will be a joystick, the arm will be an xbox controller. Thanks in advance for the assistance.

I and others can help better if you showed us what you already have completed and have working (or not working if there are errors). WPILib doc zero to robot is good but you aren’t zero so exactly where are you?

And the compressor is completely provided for you with the DoubleSolenoid.

Hopefully this might give you an idea. This is the code that we have so far. Please advise if you need more.
Thanks so much

/** This function is called periodically during autonomous. RUn all code every .2 secs */
This is actually 0.02 seconds per iteration but I don’t see your code relying on that incorrect timing in the comment.

Be careful issuing multiple motor commands per iteration. It isn’t fully predictable which ones will work or not. I suggest not stopping and restarting a motor in the same iteration. Remember the state you want and if the last one (or the first one) is to win then use just that one.

It looks like your code is only missing the motor controller to move the arm in and out. It’s been awhile since I looked at that kind of motor and I don’t remember much about it. Maybe you can use soft limits if there is an encoder and hard limit switches are usually advisable.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.