Some updates to mixing driving and shooting... More TODOs also

This commit is contained in:
Jason 2016-02-07 23:05:59 -05:00
commit 51741fe33b
2 changed files with 27 additions and 6 deletions

View File

@ -6,8 +6,16 @@
* This sample shows how to use the new CANTalon to just run a motor in a basic
* throttle mode, in the same manner as you might control a traditional PWM
* controlled motor.
*
*/
#ifndef BUTTON_LAYOUT
#define BUTTON_LAYOUT
#define TRIGGER 10 // I have no idea what the right button number is...
#define THUMB 11
#endif
class Robot: public IterativeRobot {
CANTalon r1_drive;
CANTalon r2_drive;
@ -64,10 +72,23 @@ public:
drive.Drive(&lstick);
float power = (1.0 - rstick.GetThrottle()) / 2.0;
//shooter1.Set(power);
//shooter2.Set(power);
shooter.SetPower(power);
//shooter.SetPower(power);
if(rstick.GetRawButton(TRIGGER))
{
// SHOOT THE BALL
}
if(rstick.GetRawButton(THUMB))
{
// lower the ramp
}
else
{
// raise the ramp to HALF (so it isn't down all the time!)
}
// How to pickup?
}
};

View File

@ -51,8 +51,8 @@ public:
}
float speed = y * th;
float rot = x; // TODO: do some math here to smooth out turning?
// TODO: do some math here to smooth out turning?
float rot = x * th;
dt1->ArcadeDrive(speed, rot, false);
dt2->ArcadeDrive(speed, rot, false);