-
Notifications
You must be signed in to change notification settings - Fork 0
programming
http://wpilib.screenstepslive.com/s/4485/m/13809/l/241894-creating-a-robot-project
Basically just:
- Initialize controller, set to correct PWM
- Call motorName.set(speed_you_want);
Safety with motors
- This will prevent you from continuously running a motor and breaking the robot if something gets jammed: http://wpilib.screenstepslive.com/s/4485/m/13809/l/241863-using-the-motor-safety-feature
- Basically, can set a timeout feature
http://wpilib.screenstepslive.com/s/4485/m/13809/l/241881-joysticks
- For X-box controllers, use getRawAxis and getRawButton instead
- You can view the axes that are moving using DriverStation
- This class allows you to call commands after setting 4 motors to an object
You can also manually control motors
- Set motors to all move forward / reverse based on y-val
- Set motors to all turn in one direction based on x-val
- Set one side of motors based on input (y-val) of 1st joystick
- Set other side based on input (y-val) of 2nd joystick
- May need to invert one side - otherwise you go in circles
http://wpilib.screenstepslive.com/s/4485/m/13809/l/241907-default-commands
http://wpilib.screenstepslive.com/s/4485/m/13809/l/241908-synchronizing-two-commands
- Can either run one after the other or simultaneously
http://wpilib.screenstepslive.com/s/4485/m/13809/l/277232-scheduling-commands
We use Scheduler.getInstance().add(command_name);
- Might also be able to use command_name.start(); Look at the “Requires” section too
- Can have one command that encapsulates multiple commands
http://wpilib.screenstepslive.com/s/4485/m/13809/c/88895
NOTE: There are certain ports on the roborio where
NOTE: Gyros currently only work when plugged into port 0 or 1 of Roborio
Use small values to start; print output - if it’s only 1 or -1, it’s not really PID (but if it works, feel free to use it)
http://wpilib.screenstepslive.com/s/4485/m/13809/l/241866-operating-pneumatic-cylinders-solenoids
Optional for greater control over robot (otherwise runs automatically) Still need to have one though http://wpilib.screenstepslive.com/s/4485/m/13809/l/241865-operating-a-compressor-for-pneumatics
- Justin Lin
EVHS Robotics