I have an arduino board all hooked up to a servo motor that is going to control a mechanical claw. I would like to write and code where I can enter something like '1' on my keyboard and have the motor rotate 180 degrees. then press '0' and have it rotate from 180 degrees backwards to zero. Essentially opening and closing the mechanical claw. If this is at all possible..
I found the code named 'sweep' on the arduino website and it rotates my motor correctly, I would just like to be able to control when the motor rotates using my keyboard.
I am very new to programming and have been trying to learn how to do this online to no avail.
Any help writing this code would be greatly appreciated!