Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Servo speed
03-21-2020, 10:25 AM (This post was last modified: 03-21-2020 11:22 AM by LOlsen.)
Post: #23
RE: Servo speed
I did a hardcoded work-a-round for slowing the servo down, code is below for anyone interested:

void PenDown(int intPenDownPos){
int intCurrentPos = penServo.read();
for (int i = intCurrentPos; i >= intPenDownPos; i--) {
penServo.write(i);
delay(8);
}
}

void PenUp(int intPenUpPos){
int intCurrentPos = penServo.read();
for (int i = intCurrentPos; i <= intPenUpPos; i++) {
penServo.write(i);
delay(8);
}
}


Replace the four calls to "penServo.write" with these functions. Speed is controlled by the Delay function. This works for my setup where Pen Up value is lower than Pen Down. If your setup is different, you need to change the logic of the two functions.
Good luck :-)

Best regards
Lars Lund Olsen
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Servo speed - clocey - 02-25-2018, 01:33 AM
RE: Servo speed - JJrobots JP - 02-26-2018, 05:01 PM
RE: Servo speed - clocey - 02-27-2018, 03:43 AM
RE: Servo speed - JJrobots JP - 03-02-2018, 12:54 PM
RE: Servo speed - clocey - 03-06-2018, 07:56 PM
RE: Servo speed - JJrobots JP - 03-13-2018, 12:57 PM
RE: Servo speed - preloi - 03-18-2018, 01:18 PM
RE: Servo speed - clocey - 03-20-2018, 04:46 PM
RE: Servo speed - clocey - 03-26-2018, 12:48 AM
RE: Servo speed - JohnQ - 03-27-2018, 11:03 AM
RE: Servo speed - clocey - 03-27-2018, 10:38 PM
RE: Servo speed - JJrobots JP - 04-27-2018, 12:17 AM
RE: Servo speed - LanePanet - 01-03-2019, 06:28 PM
RE: Servo speed - rhill051 - 03-26-2019, 02:50 AM
RE: Servo speed - clocey - 03-26-2019, 08:31 PM
RE: Servo speed - maddin-la - 02-27-2020, 09:50 AM
RE: Servo speed - LOlsen - 03-10-2020, 07:31 PM
RE: Servo speed - LOlsen - 03-11-2020, 01:35 PM
RE: Servo speed - JJrobots JP - 03-12-2020, 03:54 PM
RE: Servo speed - LOlsen - 03-12-2020, 05:13 PM
RE: Servo speed - LOlsen - 03-16-2020, 10:25 PM
RE: Servo speed - JJrobots JP - 03-17-2020, 05:06 PM
RE: Servo speed - LOlsen - 03-21-2020 10:25 AM
RE: Servo speed - JJrobots JP - 03-23-2020, 01:02 PM
RE: Servo speed - JohnQ - 04-13-2020, 12:22 PM
RE: Servo speed - LOlsen - 04-19-2020, 04:21 PM
RE: Servo speed - JohnQ - 04-22-2020, 08:50 AM
RE: Servo speed - SutoJL - 06-02-2020, 05:45 AM

Forum Jump:


User(s) browsing this thread: 2 Guest(s)