Asked — Edited
Resolved Resolved by Rich!

Need Help With Key Command.

I want to be able to press a button lets say "Z" and once pressed and released I want a servo to go to a certain point and then return back to where it started. I know how to make it go there while I keep a button pressed and return once I release the button. But I need it to go there and then return with only a tap of the key. Does this make sense?.


ARC Pro

Upgrade to ARC Pro

Take control of your robot's destiny by subscribing to Synthiam ARC Pro, and watch it evolve into a versatile and responsive machine.

United Kingdom
#1  

Yes that makes sense.

Basically, you need to run a script on key up and have nothing for the key down.

Then write your script to move the servo to position and back again, for instance


Servo(D0,100)
Sleep(1000)
Servo(D0,1)

There are other ways to move the servo and move it back again, check position before moving then move back to the position it was in... possibilities are endless really but if you need help with that script just say what it is doing and I'll give more help.

#2  

Thank you very much, that is exactly what I was needing. Cheers mate!.