File tree Expand file tree Collapse file tree 6 files changed +5
-4
lines changed Expand file tree Collapse file tree 6 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -44,8 +44,9 @@ class CapCtrl
4444 const int ConfigSpeed = 64 ;
4545 const int ConfigStep = 20 ;
4646 const int ConfigStepLarge = 100 ;
47- const int ConfigStepCompensate = 20 ;
47+ const int ConfigStepCompensate = 14 ;
4848 const int ConfigMaxPos = 5200 ;
49+ const int ConfigBtnDisabled = 1 ;
4950
5051 const int ConfigCalPoints = 23 ;
5152 const int ConfigCalAddr = 0x0 ;
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ bool CapCtrl::setFreq(long freqKhz)
9797
9898void CapCtrl::park ()
9999{
100- while (digitalRead (pinBtn_) == 0 )
100+ while (digitalRead (pinBtn_) == ConfigBtnDisabled )
101101 stepper_.step (1 );
102102
103103 releaseMotor ();
@@ -129,7 +129,7 @@ void CapCtrl::up()
129129
130130void CapCtrl::down ()
131131{
132- if (digitalRead (pinBtn_) == 0 && pos_ - ConfigStep >= 0 )
132+ if (digitalRead (pinBtn_) == ConfigBtnDisabled && pos_ - ConfigStep >= 0 )
133133 {
134134 stepper_.setSpeed (ConfigSpeed/8 );
135135 stepper_.step (ConfigStep);
@@ -155,7 +155,7 @@ void CapCtrl::upLarge()
155155
156156void CapCtrl::downLarge ()
157157{
158- if (digitalRead (pinBtn_) == 0 && pos_ - ConfigStepLarge >= 0 )
158+ if (digitalRead (pinBtn_) == ConfigBtnDisabled && pos_ - ConfigStepLarge >= 0 )
159159 {
160160 stepper_.setSpeed (ConfigSpeed/4 );
161161 stepper_.step (ConfigStepLarge);
You can’t perform that action at this time.
0 commit comments