Sane code for the Demo

This commit is contained in:
Jason Cox 2016-02-19 15:48:18 -05:00
parent 17bd06f9c2
commit 6b3bcbe38d
2 changed files with 9 additions and 13 deletions

View File

@ -1,13 +1,14 @@
#include "WPILib.h"
#include "Shooter.h"
#include <math.h>
#ifndef BUTTON_LAYOUT
#define BUTTON_LAYOUT
#define TRIGGER 1 // Trigger button number
#define THUMB 2 // Thumb button number
#define RAMP_RAISE 3 // Button 3 for Raising Ramp
#define RAMP_LOWER 4 // Button 4 to lower ramp.
#define RAMP_RAISE 5 // Button 3 for Raising Ramp
#define RAMP_LOWER 3 // Button 4 to lower ramp.
#define UNJAM 11
#define DEADZONE_RADIUS 0.01 // Deadzone Radius prevents tiny twitches in the joystick's value from
@ -63,8 +64,8 @@ private:
SmartDashboard::PutData("Auto Modes", chooser);
shooter1.Enable();
shooter2.Enable();
left_drive.SetInverted(true);
right_drive.SetInverted(true);
//left_drive.SetInverted(true);
//right_drive.SetInverted(true);
//launch_spinny.SetInverted(true);
inverting = false;
pickupRunning = false;
@ -100,11 +101,7 @@ private:
void AutonomousPeriodic()
{
if(autoSelected == autoNameCustom){
//Custom Auto goes here
} else {
//Default Auto goes here
}
}
void TeleopInit()
@ -115,8 +112,7 @@ private:
void TeleopPeriodic()
{
//std::cout << "Ramp position: "<< launch_spinny.GetEncPosition() << std::endl;
drive.ArcadeDrive(&driver_stick, true);
drive.ArcadeDrive(-driver_stick.GetY(), -driver_stick.GetX() * 0.75);
//bool rampDoing = false;
// This is shit code for testing. Replace it with real code.
if(!ramping && operator_stick.GetRawButton(RAMP_RAISE))

View File

@ -64,12 +64,12 @@ public:
void LowerRamp()
{
launch_spinny->Set(-1);
launch_spinny->Set(-0.5);
}
void RaiseRamp()
{
launch_spinny->Set(1);
launch_spinny->Set(0.5);
}
void StopRamp()