見出し画像

DIY Pen Plotter (2) - Programming Edition

Continuing from my previous post, this article will cover the programming aspect of the pen plotter.

1. Writing Code to Arduino
First, I wrote code for the pen plotter, referencing this website.


Since I don’t really understand programming, the code is a rough mix of copy-pasting, but it worked. The values are also random, so the size isn’t perfectly accurate. The original code used the Stepper library, but I changed it to the A4988 library.

2. Creating G-code Images with Inkscape
For the images to be drawn, I used the free software Inkscape to convert them into G-code. This website was very easy to understand.

3. Sending the Image and Starting the Drawing with Processing IDE Program (GCTRL)
I don’t fully understand this part, but by opening the "gctrl" file in a tool called Processing IDE Program, the following screen appears. You select the port with the "p" key and choose the G-code file with the "g" key to start drawing. I followed the instructions from this website for this section. After updating Processing, it stopped working. It works with version 3.5.4.

Summary
Since I only had a vague understanding of programming, this part took the most time, but there was plenty of information available online, which was helpful. The main issue is that the lines come out jagged. It seems I need to change the library controlling the movement to make the lines smoother.