I want to develop a simple C# application to control a self-made CNC machine using Arduino Uno. I want to use G-code to accomplish that. Now what I don't understand is how G-code is interpreted in Arduino? and how does it determine at which pin (GPIO) I set the spindle motor for example, or any other motor? I am sure that my understanding of the G-code working process is not very good, and here where I add the question: are there standards that force me to choose specific pins to control the CNC motors? or the G-code interpreter itself determines the pins in which the motors are set at? Thanks in advance..
G code only knows the axis that you are commanding. The interpreter (which you should list but did not) then takes the G code commands and translates them to Motor commands. In the general style of Arduino, there is usually some sets of #defines that will set the pin assignments. Something like