piston testing fr
read the title
This commit is contained in:
parent
575f79648a
commit
1cbae5ced1
@ -9,6 +9,8 @@
|
||||
#define DRIVE_RATIO 0.75
|
||||
#define DRIVE_RPM 450
|
||||
|
||||
bool ptoEnabled;
|
||||
|
||||
namespace globals {
|
||||
extern pros::Controller master;
|
||||
|
||||
@ -30,6 +32,8 @@ namespace globals {
|
||||
extern pros::Rotation rot_horiz;
|
||||
extern pros::Rotation enc_theta;
|
||||
|
||||
extern pros::ADIAnalogOut pto_piston;
|
||||
|
||||
extern lemlib::TrackingWheel vert_tracking_wheel;
|
||||
extern lemlib::TrackingWheel horiz_tracking_wheel;
|
||||
|
||||
|
||||
@ -21,4 +21,8 @@ namespace superstruct {
|
||||
void leftSwing(double theta, double swingSpeedScale);
|
||||
void rightSwing(double theta, double swingSpeedScale);
|
||||
|
||||
//- Structure methods
|
||||
void togglePto();
|
||||
bool getPtoState();
|
||||
|
||||
}
|
||||
@ -22,6 +22,7 @@ namespace globals {
|
||||
pros::Rotation rot_horiz(1);
|
||||
// pros::Rotation enc_right();
|
||||
// pros::Rotation enc_theta();
|
||||
pros::ADIAnalogOut pto_piston(1);
|
||||
|
||||
lemlib::Drivetrain_t chassis_odom {
|
||||
&left_drive,
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
#include "main.h"
|
||||
#include "lemlib/api.hpp"
|
||||
#include "globals.hpp"
|
||||
#include "superstructure.hpp"
|
||||
|
||||
using namespace globals;
|
||||
using namespace superstruct;
|
||||
|
||||
/**
|
||||
* A callback function for LLEMU's center button.
|
||||
@ -88,6 +90,10 @@ void opcontrol() {
|
||||
motor_trb.move_voltage(0);
|
||||
}
|
||||
|
||||
if (globals::master.get_digital_new_press(DIGITAL_LEFT)) {
|
||||
togglePto();
|
||||
}
|
||||
|
||||
pros::delay(20);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
|
||||
using namespace ary;
|
||||
using namespace globals;
|
||||
|
||||
bool ptoEnabled = false;
|
||||
namespace superstruct {
|
||||
void configureExitConditions() {
|
||||
chassis.set_exit_condition(chassis.turn_exit, 100, 3, 500, 7, 500, 500);
|
||||
@ -52,4 +54,15 @@ namespace superstruct {
|
||||
//chassis.set_mode(SWING);
|
||||
chassis.set_swing(RIGHT_SWING, theta, SWING_SPEED * swingSpeedScale);
|
||||
}
|
||||
|
||||
// Structure methods
|
||||
|
||||
void togglePto() {
|
||||
int state = (ptoEnabled) ? 1 : 0;
|
||||
pto_piston.set_value(state);
|
||||
}
|
||||
|
||||
// bool getPtoState() {
|
||||
// return (pto_piston.get_value() == 1) ? true : false;
|
||||
// }
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user