Added PacGoat code for C++.

Change-Id: I4fd19fbdc65c25c5bbcdce937a31bc6fa1c11cb4
This commit is contained in:
Alex Henning
2014-06-24 16:54:17 -07:00
parent 0d62d0985a
commit c7e17b8e35
47 changed files with 1659 additions and 4 deletions

View File

@@ -0,0 +1,19 @@
/*
* DoubleButton.cpp
*
* Created on: Jun 24, 2014
* Author: alex
*/
#include "DoubleButton.h"
DoubleButton::DoubleButton(Joystick* joy, int button1, int button2) {
this->joy = joy;
this->button1 = button1;
this->button2 = button2;
}
bool DoubleButton::Get() {
return joy->GetRawButton(button1) && joy->GetRawButton(button2);
}

View File

@@ -0,0 +1,24 @@
/*
* DoubleButton.h
*
* Created on: Jun 24, 2014
* Author: alex
*/
#ifndef DOUBLEBUTTON_H_
#define DOUBLEBUTTON_H_
#include "WPILib.h"
class DoubleButton : public Trigger {
private:
Joystick* joy;
int button1, button2;
public:
DoubleButton(Joystick* joy, int button1, int button2);
bool Get();
};
#endif /* DOUBLEBUTTON_H_ */