Skip to content

Commit e3036fc

Browse files
authored
update calibration.ino
1 parent e4b1620 commit e3036fc

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

examples/Calibration/Calibration.ino

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/*
2-
Controlling a servo position using a potentiometer (variable resistor)
3-
by Michal Rinott <http://people.interaction-ivrea.it/m.rinott>
2+
This Example is for Calibration on uArm.
43
5-
modified on 8 Nov 2013
6-
by Scott Fitzgerald
7-
http://www.arduino.cc/en/Tutorial/Knob
4+
1. It will wait you press D7 to start.
5+
2. First it would auto detect the SERVO_LEFT maximum angle and SERVO_RIGHT minimum angle
6+
3. Second it would collect hundreads of point for each servo to caculate the Linear regression
7+
4. Third it will wait you to move uArm to correct position to calibrate the SERVO_ROT, You could refer this picture.
8+
https://raw.githubusercontent.com/uArm-Developer/UArmForArduino/dev/examples/Metal/calibration.png
89
*/
910

1011
#include <Servo.h>
@@ -101,13 +102,17 @@ void loop() {
101102
delay(2000);
102103
Serial.println("[STEP]LIMITATION");
103104
get_limit_values();
105+
delay(500);
104106
Serial.println("[STEP]LINEAR");
105107
linear_calibration();
108+
delay(500);
106109
Serial.println("[STEP]MANUAL");
110+
delay(500);
107111
Serial.println("[INFO]Waiting For Manual Calibration, Please Press D4 Once Completed.");
108112
waitingForManualCalibration();
113+
delay(500);
109114
EEPROM.write(CALIBRATION_FLAG, CONFIRM_FLAG);
110-
delay(20);
115+
delay(500);
111116
Serial.println("[STEP]COMPLETED");
112117
alert(1, 500, 500);
113118
}
@@ -457,4 +462,3 @@ void save_linear_servo_offset(byte servo_num, double intercept_val, double slope
457462
EEPROM.put(LINEAR_INTERCEPT_START_ADDRESS + servo_num * sizeof(intercept_val), intercept_val);
458463
EEPROM.put(LINEAR_SLOPE_START_ADDRESS + servo_num * sizeof(slope_val), slope_val);
459464
}
460-

0 commit comments

Comments
 (0)