mirror of
https://github.com/team2059/Dent
synced 2024-12-18 20:52:29 -05:00
Added compressor auto-disable
This commit is contained in:
parent
11bfb827c8
commit
e3b80c6513
@ -8,11 +8,14 @@ HHBase::HHBase():
|
||||
printf("Done\n");
|
||||
}
|
||||
void HHBase::RobotInit(){
|
||||
hhbot->Init();
|
||||
}
|
||||
void HHBase::DisabledInit(){}
|
||||
void HHBase::AutonomousInit(){
|
||||
hhbot->Init();
|
||||
}
|
||||
void HHBase::TeleopInit(){
|
||||
hhbot->Init();
|
||||
}
|
||||
void HHBase::DisabledContinuous(){}
|
||||
void HHBase::AutonomousContinuous(){}
|
||||
|
@ -2,15 +2,17 @@
|
||||
#include "HHBase.h"
|
||||
HHRobot::HHRobot():
|
||||
DriveStick(new Extreme3dPro(0)),
|
||||
AirCompressor(new Compressor(30)),
|
||||
PowerDistPanel(new PowerDistributionPanel()),
|
||||
//FrontRight,FrontLeft,RearRight,RearLeft
|
||||
RobotDrive(new MecanumDrive(40,41,42,43)){
|
||||
}
|
||||
void HHRobot::Init(){
|
||||
printf("Initing\n");
|
||||
printf("Code Version: %f\n",0000.1);
|
||||
}
|
||||
//Main function used to handle periodic tasks on the robot
|
||||
void HHRobot::Handler(){
|
||||
//Code to lock the axis when driving
|
||||
double x,y,z;
|
||||
if (DriveStick->GetJoystickButton(1)){
|
||||
y = 0;
|
||||
@ -26,6 +28,12 @@ void HHRobot::Handler(){
|
||||
x = DriveStick->GetJoystickAxis("x");
|
||||
z = DriveStick->GetJoystickAxis("z");
|
||||
}
|
||||
RobotDrive->handler(x,y,z,0);
|
||||
//X axis, Y axis, Z axis, acceleration, threshold, gyro
|
||||
RobotDrive->handler(x,y,z,0.5,1,0);
|
||||
|
||||
//Disables the compressor if the battery voltage is detected to be less than 10 volts
|
||||
if (PowerDistPanel->GetVoltage()<=10){
|
||||
AirCompressor->Stop();
|
||||
}
|
||||
}
|
||||
// vim: ts=2:sw=2:et
|
||||
|
@ -7,6 +7,9 @@
|
||||
class HHRobot{
|
||||
private:
|
||||
Extreme3dPro *DriveStick;
|
||||
//CAN Devices
|
||||
Compressor *AirCompressor;
|
||||
PowerDistributionPanel *PowerDistPanel;
|
||||
MecanumDrive *RobotDrive;
|
||||
public:
|
||||
HHRobot();
|
||||
|
Loading…
Reference in New Issue
Block a user