# Strange behavior from VEX claw assembly using servo command

I noticed something odd when I tried to loop a claw so it would just open and close (eventually I want to have it just open when the ultrasonic sensor detects something in front of it and close a second or so later). Anyhow, when I tried a loop using the setServo command it loops, but the claw opens less and less each time -- the first time it opens fully, then after three iterations a little less, and so on until it hardly opens at all. I added a motor command line and that seemed to solve it, but it seems a kludgy workaround and I wondered if it was a misuse of the setServo command on a VEX 393 motor, which is what VEX is using on the claw assemblies. In any case, this is the code I used

#pragma config(Motor,  port1,           claw2,         tmotorVex393_HBridge, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

{repeat(forever)
{setServo();
wait(1);
setServo(port1, -127);
wait(1);
setServo();
setServo(port1, 127);
}}


Anyhow if there's anything weird about this code and someone could let me know... I suspect the issue is something simple that I am not seeing and thanks in advance.

• i don't know anything about the VEX programming language, but setServo() looks out of place ... also, is wait(1) long enough for the servo to arrive at its destination? – jsotola Nov 13 '19 at 5:46
• I hadn't thought of the wait being long enough -- I will see what happens when I try extending it. SetServo() just sets the servo to the zero position. – Jesse Nov 13 '19 at 10:11
• @jsotola - I tried changing the wait time; it didn't seem to have an effect – Jesse Nov 14 '19 at 2:47