Skip to content

Commit 314a503

Browse files
committed
Fix
1 parent a62822d commit 314a503

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

supplements/arduino_control/arduino_control_v2.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const long interval = 60000;
3535

3636
/* Servo control */
3737
#include <VarSpeedServo.h>
38-
const int servo_speed = 60; // 0-255
38+
const int servo_speed = 40; // default speed range 0-255
3939
VarSpeedServo p_sv;
4040
VarSpeedServo y_sv;
4141

@@ -57,22 +57,22 @@ void servo_cb(const std_msgs::UInt16MultiArray& msg) {
5757
y_sv.write(y, msg.data[2], true);
5858
}
5959
else if (msg.data[2] >= 255) {
60-
p_sv.write(p, 255, false);
61-
y_sv.write(y, 255, true);
60+
p_sv.write(p, servo_speed, false);
61+
y_sv.write(y, servo_speed, true);
6262
}
6363
}
6464
else if (msg.data_length == 4) {
6565
if (msg.data[2] > 0 && msg.data[2] < 255) {
6666
p_sv.write(p, msg.data[2], false);
6767
}
6868
else if (msg.data[2] >= 255) {
69-
p_sv.write(p, 255, false);
69+
p_sv.write(p, servo_speed, false);
7070
}
7171
if (msg.data[3] > 0 && msg.data[3] < 255) {
7272
y_sv.write(y, msg.data[3], true);
7373
}
7474
else if (msg.data[3] >= 255) {
75-
y_sv.write(y, 255, true);
75+
y_sv.write(y, servo_speed, true);
7676
}
7777
}
7878
active = true;

0 commit comments

Comments
 (0)