mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Added PacGoat code for C++.
Change-Id: I4fd19fbdc65c25c5bbcdce937a31bc6fa1c11cb4
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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_ */
|
||||
Reference in New Issue
Block a user