From 6e7f2435abbc5ca46559b4f81bdb93968b1ad3a7 Mon Sep 17 00:00:00 2001 From: Adam Long Date: Wed, 2 Apr 2014 16:37:26 -0700 Subject: [PATCH 1/5] Preparing for merge to use old pot code --- MyRobot.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MyRobot.cpp b/MyRobot.cpp index 2c69807..0ad4605 100644 --- a/MyRobot.cpp +++ b/MyRobot.cpp @@ -503,6 +503,7 @@ public: compressing=false; compressor.Stop(); } +} //}}} //Teleop{{{ void OperatorControl(){ @@ -571,7 +572,7 @@ public: }else{ //Stop Shooting{{{ shooting=false; - shootRobot(0); + shootRobot(0.0f); //}}} } if(Rstick.GetRawButton(9)==1){ From 396e18c1c48586d7400837c5a69041b019645b21 Mon Sep 17 00:00:00 2001 From: Adam Long Date: Wed, 2 Apr 2014 16:39:19 -0700 Subject: [PATCH 2/5] Removed the old pot code --- MyRobot.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/MyRobot.cpp b/MyRobot.cpp index 0ad4605..ee33ace 100644 --- a/MyRobot.cpp +++ b/MyRobot.cpp @@ -170,11 +170,6 @@ public: } //}}} //potToDegrees{{{ - float potToDegrees(float a){ - float max=-.0003948; - float min=5.0245547; - return 300-(a*(300/(min-max))); - } //}}} //cvt{{{ int cvt(float input){ From 8303b7985071c243b4932c75a342b937e6726065 Mon Sep 17 00:00:00 2001 From: Adam Long Date: Wed, 2 Apr 2014 16:42:21 -0700 Subject: [PATCH 3/5] Reverted to the old pot conversion code that worked (may or may not be the issue currently) --- MyRobot.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MyRobot.cpp b/MyRobot.cpp index ee33ace..e4a4e9a 100644 --- a/MyRobot.cpp +++ b/MyRobot.cpp @@ -170,6 +170,14 @@ public: } //}}} //potToDegrees{{{ + float potToDegrees(float a) { + float max = -.0003948; + float min = 5.0245547; + float b = a - max; + min = min - max; // ~5.0027 + max = max - max; //=0 + return 300 - ((b + max) * (300 / min)); + } //}}} //cvt{{{ int cvt(float input){ From 5653ed54eb14c0efcf4f53e54f22bf03ee5ff2cf Mon Sep 17 00:00:00 2001 From: Adam Long Date: Wed, 2 Apr 2014 17:00:46 -0700 Subject: [PATCH 4/5] fixed another missed brace --- MyRobot.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MyRobot.cpp b/MyRobot.cpp index e4a4e9a..b8d23cc 100644 --- a/MyRobot.cpp +++ b/MyRobot.cpp @@ -253,14 +253,15 @@ public: //}}} //runCompressor{{{ void runCompressor(int timer, int refreshInterval){ - if(timer%refreshInterval==0&compressing&comressor.GetPressureSwitchValue()==1){ + if(timer%refreshInterval==0&compressing&compressor.GetPressureSwitchValue()==1){ compressing=false; compressor.Stop(); } - if(timer%refreshInterval==0&!compressing&comressor.GetPressureSwitchValue()==0){ + if(timer%refreshInterval==0&!compressing&compressor.GetPressureSwitchValue()==0){ compressing=true; compressor.Start(); } + } //}}} //Autonomous{{{ void Autonomous(){ From eef71313f0e9cf63a85c83d4f75e81d0078eb172 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Thu, 3 Apr 2014 15:13:42 -0400 Subject: [PATCH 5/5] Made runCompressor clearer --- MyRobot.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MyRobot.cpp b/MyRobot.cpp index b8d23cc..02af8f1 100644 --- a/MyRobot.cpp +++ b/MyRobot.cpp @@ -252,12 +252,12 @@ public: } //}}} //runCompressor{{{ - void runCompressor(int timer, int refreshInterval){ - if(timer%refreshInterval==0&compressing&compressor.GetPressureSwitchValue()==1){ + void runCompressor(int i, int refreshInterval){ + if(i%refreshInterval==0&compressing&compressor.GetPressureSwitchValue()==1){ compressing=false; compressor.Stop(); } - if(timer%refreshInterval==0&!compressing&compressor.GetPressureSwitchValue()==0){ + if(i%refreshInterval==0&!compressing&compressor.GetPressureSwitchValue()==0){ compressing=true; compressor.Start(); }