diff --git a/src/HHRobot.cpp b/src/HHRobot.cpp index 0ceb0af..5f6f401 100644 --- a/src/HHRobot.cpp +++ b/src/HHRobot.cpp @@ -11,6 +11,21 @@ void HHRobot::Init(){ } //Main function used to handle periodic tasks on the robot void HHRobot::Handler(){ - RobotDrive->handler(DriveStick->GetJoystickAxis("x"),DriveStick->GetJoystickAxis("y"),DriveStick->GetJoystickAxis("z"),0); + double x,y,z; + if (DriveStick->GetJoystickButton(1)){ + y = 0; + z = 0; + }else{ + y = DriveStick->GetJoystickAxis("y"); + z = DriveStick->GetJoystickAxis("z"); + } + if (DriveStick->GetJoystickButton(2)){ + x = 0; + z = 0; + }else{ + x = DriveStick->GetJoystickAxis("x"); + z = DriveStick->GetJoystickAxis("z"); + } + RobotDrive->handler(x,y,z,0); } // vim: ts=2:sw=2:et diff --git a/src/Makefile b/src/Makefile index 01fcaa2..30207ea 100644 --- a/src/Makefile +++ b/src/Makefile @@ -4,7 +4,8 @@ CFLAGS=-std=c++11 -O0 -g3 -Wall -c -fmessage-length=0 LDFLAGS=-Wl,-rpath,/opt/GenICam_v2_3/bin/Linux_armv7-a SOURCES=$(shell find -type f -name "*.cpp") OBJECTS=$(SOURCES:.cpp=.o) -WPILIB=/var/frc/wpilib EXEC=bin/FRCUserProgram +WPILIB=/var/frc/wpilib +EXEC=bin/FRCUserProgram CLEANSER=rm -r all : $(OBJECTS) diff --git a/src/Makefile.old b/src/Makefile.old index 01fcaa2..30207ea 100644 --- a/src/Makefile.old +++ b/src/Makefile.old @@ -4,7 +4,8 @@ CFLAGS=-std=c++11 -O0 -g3 -Wall -c -fmessage-length=0 LDFLAGS=-Wl,-rpath,/opt/GenICam_v2_3/bin/Linux_armv7-a SOURCES=$(shell find -type f -name "*.cpp") OBJECTS=$(SOURCES:.cpp=.o) -WPILIB=/var/frc/wpilib EXEC=bin/FRCUserProgram +WPILIB=/var/frc/wpilib +EXEC=bin/FRCUserProgram CLEANSER=rm -r all : $(OBJECTS)