From a5a48916491ef8078a828a9ba4fbc0b47e11af33 Mon Sep 17 00:00:00 2001 From: Adam Long Date: Thu, 3 Apr 2014 14:17:28 -0700 Subject: [PATCH] Added a joystick update function for later use when implementing multiple joystick support (different models of joysticks) --- MyRobot.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/MyRobot.cpp b/MyRobot.cpp index 6a1fff2..2231196 100644 --- a/MyRobot.cpp +++ b/MyRobot.cpp @@ -263,6 +263,22 @@ public: } } //}}} + //{{{updateJoystick + bool* updateJoystick(int joystick){ + if(joystick==1){ + for(i=1,i<=12,i++){ + state[joystick][i] = Lstick.GetRawButton(i); + } + return state; + } + if(joystick==2){ + for(i=1,i<=12,i++){ + state[joystick][i] = Rstick.GetRawButton(i); + } + return state; + } + } + //}}} //Autonomous{{{ void Autonomous(){ //Initializations{{{