Skip to content

Commit 7b3db98

Browse files
committed
chore(rocking-servo): Finalize config
1 parent 90ef20f commit 7b3db98

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

rocking-servo/rocking-servo.ino

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <Servo.h>
22

3-
#define START_ANGLE 45
4-
#define STOP_ANGLE 150
3+
#define START_ANGLE 90
4+
#define STOP_ANGLE 120
55
#define LOOP_DELAY 250
66
#define SRV_PIN 9
77
#define SPD_PIN A0
@@ -13,7 +13,7 @@ const int loopDelay = LOOP_DELAY;
1313
const int srvPin = SRV_PIN;
1414
const int spdPin = SPD_PIN;
1515

16-
const int stepAngle = 10;
16+
const int stepAngle = 1;
1717

1818
Servo srv;
1919

@@ -35,15 +35,13 @@ int getSpd() {
3535
}
3636

3737
int getStepDelay(int spd) {
38-
return 100 - 10*spd;
38+
return (10 - spd) * 2;
3939
}
4040

41-
4241
int pos = startAngle;
4342
int spd = 0;
4443
bool fw = true;
4544

46-
4745
void loop() {
4846
spd = getSpd();
4947

0 commit comments

Comments
 (0)