mirror of
https://github.com/team2059/Zaphod
synced 2024-12-18 20:12:28 -05:00
Merge branch 'master' of 76.182.74.61:hitchhikers/MyRobot
This commit is contained in:
commit
69ded3ddad
21
MyRobot.cpp
21
MyRobot.cpp
@ -170,10 +170,13 @@ public:
|
|||||||
}
|
}
|
||||||
//}}}
|
//}}}
|
||||||
//potToDegrees{{{
|
//potToDegrees{{{
|
||||||
float potToDegrees(float a){
|
float potToDegrees(float a) {
|
||||||
float max=-.0003948;
|
float max = -.0003948;
|
||||||
float min=5.0245547;
|
float min = 5.0245547;
|
||||||
return 300-(a*(300/(min-max)));
|
float b = a - max;
|
||||||
|
min = min - max; // ~5.0027
|
||||||
|
max = max - max; //=0
|
||||||
|
return 300 - ((b + max) * (300 / min));
|
||||||
}
|
}
|
||||||
//}}}
|
//}}}
|
||||||
//cvt{{{
|
//cvt{{{
|
||||||
@ -249,15 +252,16 @@ public:
|
|||||||
}
|
}
|
||||||
//}}}
|
//}}}
|
||||||
//runCompressor{{{
|
//runCompressor{{{
|
||||||
void runCompressor(int timer, int refreshInterval){
|
void runCompressor(int i, int refreshInterval){
|
||||||
if(timer%refreshInterval==0&compressing&comressor.GetPressureSwitchValue()==1){
|
if(i%refreshInterval==0&compressing&compressor.GetPressureSwitchValue()==1){
|
||||||
compressing=false;
|
compressing=false;
|
||||||
compressor.Stop();
|
compressor.Stop();
|
||||||
}
|
}
|
||||||
if(timer%refreshInterval==0&!compressing&comressor.GetPressureSwitchValue()==0){
|
if(i%refreshInterval==0&!compressing&compressor.GetPressureSwitchValue()==0){
|
||||||
compressing=true;
|
compressing=true;
|
||||||
compressor.Start();
|
compressor.Start();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//}}}
|
//}}}
|
||||||
//Autonomous{{{
|
//Autonomous{{{
|
||||||
void Autonomous(){
|
void Autonomous(){
|
||||||
@ -503,6 +507,7 @@ public:
|
|||||||
compressing=false;
|
compressing=false;
|
||||||
compressor.Stop();
|
compressor.Stop();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//}}}
|
//}}}
|
||||||
//Teleop{{{
|
//Teleop{{{
|
||||||
void OperatorControl(){
|
void OperatorControl(){
|
||||||
@ -571,7 +576,7 @@ public:
|
|||||||
}else{
|
}else{
|
||||||
//Stop Shooting{{{
|
//Stop Shooting{{{
|
||||||
shooting=false;
|
shooting=false;
|
||||||
shootRobot(0);
|
shootRobot(0.0f);
|
||||||
//}}}
|
//}}}
|
||||||
}
|
}
|
||||||
if(Rstick.GetRawButton(9)==1){
|
if(Rstick.GetRawButton(9)==1){
|
||||||
|
Loading…
Reference in New Issue
Block a user