# PlotterBot Tiny CNC robot code Here we can find code to play and hack with the [PlotterBot](https://plotterbot.com/2013/11/better-video-of-tiny-cnc-drawing-robot-actually-drawing/), **a Tiny CNC Robot**. Note thre are two types of robots: a 2-Axes and a 3-axis. As we are interested in learning this to apply it to **HomeScope** we will focus here on hacking a 2-axes version. The original codes can be located at: https://github.com/MakerBlock/TinyCNC-Sketches But since the idea is to play and learn about [G-code](https://en.wikipedia.org/wiki/G-code.) to apply it to HomeScope, we post here our own version. **G code**'s name has a G from Geometry. It is an important language for robotics so it is useful to be aware of it. We Hacked [This file](https://github.com/MakerBlock/TinyCNC-Sketches/blob/master/TinyCNC_Gcode/TinyCNC_Gcode.ino) to produce the one listed here below. For example to move in a line use: `G1 X30 Y50` Other geometriic primitives are constructed but not called in the code. Two things to Note: (i) Servos are connecter at GPIOs 10 and 11 (not 9 and 10 as we use for Arduino_XY codes). (ii) Serial port communication for G-code commands is set to 115200 bts not the default 9600 We Hacked [This file](https://github.com/MakerBlock/TinyCNC-Sketches/blob/master/TinyCNC_Gcode/TinyCNC_Gcode.ino) to produce ours. The code we have to play is: > `TinyCNC_Gcode_XY_noZ.ino` Note the **CNC robot** moves more smoothly compared with oour raw Servo degrees code used in Arduino XY. Therefore XY code can be improved incorporating the mechanical aspects of gears used here. However it moves too fast as it is meant to draw. The speed under the microscope magnification should be considerably slower. For further thought see: [Mechanics considerations](https://plotterbot.com/2013/11/design-considerations-with-the-tiny-cnc/) and [Gear calculator](https://www.cgtk.co.uk/metalwork/calculators/gears)