2
0
mirror of https://github.com/team2059/Dent synced 2024-12-28 21:02:30 -05:00

Added compressor auto-disable

This commit is contained in:
Adam Long 2015-01-17 12:28:12 +00:00
parent 11bfb827c8
commit e3b80c6513
3 changed files with 16 additions and 2 deletions

View File

@ -8,11 +8,14 @@ HHBase::HHBase():
printf("Done\n"); printf("Done\n");
} }
void HHBase::RobotInit(){ void HHBase::RobotInit(){
hhbot->Init();
} }
void HHBase::DisabledInit(){} void HHBase::DisabledInit(){}
void HHBase::AutonomousInit(){ void HHBase::AutonomousInit(){
hhbot->Init();
} }
void HHBase::TeleopInit(){ void HHBase::TeleopInit(){
hhbot->Init();
} }
void HHBase::DisabledContinuous(){} void HHBase::DisabledContinuous(){}
void HHBase::AutonomousContinuous(){} void HHBase::AutonomousContinuous(){}

View File

@ -2,15 +2,17 @@
#include "HHBase.h" #include "HHBase.h"
HHRobot::HHRobot(): HHRobot::HHRobot():
DriveStick(new Extreme3dPro(0)), DriveStick(new Extreme3dPro(0)),
AirCompressor(new Compressor(30)),
PowerDistPanel(new PowerDistributionPanel()),
//FrontRight,FrontLeft,RearRight,RearLeft //FrontRight,FrontLeft,RearRight,RearLeft
RobotDrive(new MecanumDrive(40,41,42,43)){ RobotDrive(new MecanumDrive(40,41,42,43)){
} }
void HHRobot::Init(){ void HHRobot::Init(){
printf("Initing\n"); printf("Initing\n");
printf("Code Version: %f\n",0000.1);
} }
//Main function used to handle periodic tasks on the robot //Main function used to handle periodic tasks on the robot
void HHRobot::Handler(){ void HHRobot::Handler(){
//Code to lock the axis when driving
double x,y,z; double x,y,z;
if (DriveStick->GetJoystickButton(1)){ if (DriveStick->GetJoystickButton(1)){
y = 0; y = 0;
@ -26,6 +28,12 @@ void HHRobot::Handler(){
x = DriveStick->GetJoystickAxis("x"); x = DriveStick->GetJoystickAxis("x");
z = DriveStick->GetJoystickAxis("z"); 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 // vim: ts=2:sw=2:et

View File

@ -7,6 +7,9 @@
class HHRobot{ class HHRobot{
private: private:
Extreme3dPro *DriveStick; Extreme3dPro *DriveStick;
//CAN Devices
Compressor *AirCompressor;
PowerDistributionPanel *PowerDistPanel;
MecanumDrive *RobotDrive; MecanumDrive *RobotDrive;
public: public:
HHRobot(); HHRobot();