This Project has codes that may cnc controller possible. My cnc has 2 mechanical axis. I am monitoring through switches the axis limits. For this i use the library rtos. Enjoy.

Dependencies:   mbed-rtos mbed