Simple drawing using the robotic arm
You can now ask your arm to hold a drawing pen by simply opening the claw, inserting a pen, and closing the claw. You'll probably want to use some sort of marker or other drawing device with a wide tip and lots of color. The following is the arm holding the pen:
![](https://static.packt-cdn.com/products/9781784396282/graphics/3953_05_14.jpg)
If you adjust the servo that moves the entire arm up and down, you can make the pen touch the paper, as follows:
![](https://static.packt-cdn.com/products/9781784396282/graphics/3953_05_15.jpg)
Finally, if you move the servo that turns the base, you can draw your first curved line, similar to the following image:
![](https://static.packt-cdn.com/products/9781784396282/graphics/3953_05_16.jpg)
This is wonderful, but drawing only curved lines will not be particularly useful; besides, an interface where the user enters the servo locations one at a time to try and draw a more complex drawing will be unacceptable. What you need is a program that takes an x-y location input and moves the robotic arm to that point with the proper servo positions.
Since the input coming from the computer will be the x and y location for a point, you'll need to translate that value...