From 6ea107bf4e60196cf9cf821b7621b799fe32f612 Mon Sep 17 00:00:00 2001 From: ary Date: Tue, 10 Oct 2023 10:21:37 -0400 Subject: [PATCH] resolve my skill issue #pragma once --- RELENTLESS/include/globals.hpp | 7 +++---- RELENTLESS/include/superstructure.hpp | 2 -- RELENTLESS/include/wings.h | 1 + RELENTLESS/src/globals.cpp | 2 ++ RELENTLESS/src/superstructure.cpp | 6 ++---- RELENTLESS/src/wings.cpp | 2 +- 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/RELENTLESS/include/globals.hpp b/RELENTLESS/include/globals.hpp index 89598ee..37fbacf 100644 --- a/RELENTLESS/include/globals.hpp +++ b/RELENTLESS/include/globals.hpp @@ -1,8 +1,5 @@ #include "main.h" -#include "okapi/api.hpp" -#include "lemlib/api.hpp" -#include "ary-lib/drive/drive.hpp" -#include "wings.h" +#include "Wings.h" #define TRACK_WIDTH 11.5 #define PLACEHOLDER_TC_OFFSET 2.5 @@ -36,6 +33,8 @@ namespace globals { extern pros::ADIDigitalOut left_wing_piston; extern pros::ADIDigitalOut right_wing_piston; + extern Wings wings; + extern lemlib::TrackingWheel vert_tracking_wheel; extern lemlib::TrackingWheel horiz_tracking_wheel; diff --git a/RELENTLESS/include/superstructure.hpp b/RELENTLESS/include/superstructure.hpp index 914761c..705c4b1 100644 --- a/RELENTLESS/include/superstructure.hpp +++ b/RELENTLESS/include/superstructure.hpp @@ -1,6 +1,4 @@ #include "main.h" -#include "ary-lib/api.hpp" -#include "globals.hpp" #define DRIVE_SPEED 110 #define TURN_SPEED 90 diff --git a/RELENTLESS/include/wings.h b/RELENTLESS/include/wings.h index 8e4d90f..ac870ba 100644 --- a/RELENTLESS/include/wings.h +++ b/RELENTLESS/include/wings.h @@ -1,3 +1,4 @@ +#pragma once #ifndef _Wings_h #define _Wings_h_ diff --git a/RELENTLESS/src/globals.cpp b/RELENTLESS/src/globals.cpp index f6959e5..50858d7 100644 --- a/RELENTLESS/src/globals.cpp +++ b/RELENTLESS/src/globals.cpp @@ -26,6 +26,8 @@ namespace globals { pros::ADIDigitalOut left_wing_piston('C'); pros::ADIDigitalOut right_wing_piston('B'); + Wings wings; + lemlib::Drivetrain_t chassis_odom { &left_drive, &right_drive, diff --git a/RELENTLESS/src/superstructure.cpp b/RELENTLESS/src/superstructure.cpp index 2fde49a..1d3591a 100644 --- a/RELENTLESS/src/superstructure.cpp +++ b/RELENTLESS/src/superstructure.cpp @@ -165,13 +165,11 @@ namespace superstruct { void wingsControl() { if (globals::master.get_digital_new_press(DIGITAL_L2)) { - left_wing_piston.set_value(1); - right_wing_piston.set_value(1); + wings.open(); } if (globals::master.get_digital_new_press(DIGITAL_L1)) { - left_wing_piston.set_value(0); - right_wing_piston.set_value(0); + wings.close(); } } } \ No newline at end of file diff --git a/RELENTLESS/src/wings.cpp b/RELENTLESS/src/wings.cpp index 2bd63aa..1230c42 100644 --- a/RELENTLESS/src/wings.cpp +++ b/RELENTLESS/src/wings.cpp @@ -1,5 +1,5 @@ #include "main.h" -#include "wings.h" +#include "Wings.h" using namespace globals;