Team Help Programming Code

Did not know if there was any team out there that would be willing to help a struggling team. It is our first year back in a couple years. Our programmer is no longer with us. We are a very small rural team.
What we are looking for is some to write a simple code for us. We currently are using an old code that was on the RoboRIO to test items.
What we need is the following:
2 joysticks
1 to drive in Mech
1 to operate everything else.

Joystick 1
Mech Drive is 0-3 PWM slots

joystick 2
Arm Motor - on y axis of joystick

button to run a motor one direction
same button to run a motor the other direction

button to turn motor on and run in one direction

button to run 1 or 2 double solenoid

button to run 2 of 2 double solenoid

button to run 1 of 2 single solenoid

button to run 2 of 2 single solenoid

We are using Sparks motor controller

I am sure some one will ask us to post what we have, we have NOTHING.

thanks
zebrabots

“Drive in Mech” you mean Mecanum? If so a lot of teams do strafing side to side and either use a joystick that has a z axis or use something like an xbox controller and use the bumpers to rotate while left/right strafes.

Joystick 1:
Which wheel is which PWM?

“button to run a motor one direction
same button to run a motor the other direction”
Does this motor run continuously? If not what stops it. Time? Usually better to have different directions on different buttons IMO. You can then decide to either button press on button press off or hold on release off or on press run for X seconds

“button to turn motor on and run in one direction”
Same as above what stops this motor?

Do you have 4 solenoids? Same as above what turns these off?

Do you have a programmer that is interested in learning and hasn’t or do you have nobody?
I would feel more comfortable doing this with someone watching both for feedback and so that they could learn.

1 Like

yes Mecanum
all we have is logic joystick
right front PWM0
right back PWM1
left front PWM2
left back PWM3

button to run one motor - yes when the button pushed it should run in one direction continuously until we let go of the button

yes same as above to second motor

we have 4 solenoids
2 doubles
2 singles
letting off the button should shut them off.

no their is no one else. we are very small and we have had about a total of 3 weeks off school and we can not pull any one off. we are not going to be ready for stop build day anyway.

can you please send a link with the controllers (joysticks) you have?

So I am seeing the need for:
Joystick 1:
1 button to rotate left (on drive joystick)
1 button to rotate right (on drive joystick)

Joystick 2:
Y axis runs Motor 1. Deadband here? Scaling?
Run Motor 2 Positive on while pressed
Run Motor 2 Negative on while pressed
Run Motor 3 Positive on while pressed
Solenoid 1 out while pressed
Solenoid 2 out while pressed
Solenoid 3 forward while pressed, reverse when released
Solenoid 4 forward while pressed, reverse when released

Do you have more descriptive names for any of: Motor 1, Motor 2, Motor 3, Solenoid 1, Solenoid 2, Solenoid 3, Solenoid 4?

Joystick Link:
https://support.logitech.com/en_us/product/attack-3-joystick

Joystick 1 - the following means it is mecanum control? If so, then yes you are correct.

Joystick 1:
1 button to rotate left (on drive joystick)
1 button to rotate right (on drive joystick)

Joystick 2:
Y axis runs Motor 1. Deadband here? Scaling?
Run Motor 2 Positive on while pressed
Run Motor 2 Negative on while pressed
Run Motor 3 Positive on while pressed
Solenoid 1 out while pressed
Solenoid 2 out while pressed
Solenoid 3 forward while pressed, reverse when released
Solenoid 4 forward while pressed, reverse when released

We do not have any more specific names.

Thank you so much for helping. we are dying!

Here is your code

Keep in mind I have set some basic motor numbers in general I kept things at 20% Power & -20% Power. You can go in and adjust those power levels by changing them to a number between 1 and -1 for 100% and -100% respectively.

Good luck and let us know how it goes! If you have specific questions about it PM me and we can talk via phone or something.

1 Like

Additionally, if you’re up for it, I have a GitHub RecruitRIO program that I keep to teach my code team.

I’d highly recommend you check out the examples in there, as they are quite helpful and how I mentored my team in Java. I hope it helps and I wish you the best in the future!

1 Like

@zebrabots Were you able to try the code?

Did you have issues?

The code worked perfect. We are able to test and drive late Monday night.

We can thank you enough. I think we have found a temp programming that can at least manipulate the code you sent to fine tune it.

Again you are a life saver. We had no idea what we were going to do.

No problem I am glad it worked for you guys and I hope you can get someone on the team inspired to tweak and make it better.

There are several things I did not do that if you are interested in learning about you may consider roughly in the order I would prioritize them:

  • Adding your teleop code to the auto VI so that you can use your teleop code during Sandstorm
  • Using a gyro to aid in positioning
  • Making some of the buttons maintain state. Press it goes “on” press it goes “off” rather than having to hold them in.
  • Field oriented drive. I find this makes mecanum easier to manipulate
  • Encoders to go set distances also helps with positioning.

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