procedure 5¶
After getting pixels of the drawn shapes. now we could make some action with them. The Idea is to convert the pixels positions into formate that can be understand by microcontroller. Dr Salman advice as to deal with a high advance technology called (grbl).
What is GRBL?¶
GRBL is a totally free, open-source software that was developed as motion control for a microcontroller board. it’s basically the steps movement request that can be relay on to move our motors.
So how can we reach to grbl formating?¶
well, we have pixels positions. if we found a way to convert these positions into GRBL steps. we would done from this task. due to lack of time, we don’t have time to search and understand the method of conversion. so we simply went to ChatGPT asked to get the needed conversion code to do that part.
Problem with chatGPT code¶
dispit the power of chatGPT, the code that we got from it is not perfect, we got a code that convert the pixels positions into cartesian coordinate, and that’s not what are we looking for!
We need a way to convert cartesian coordinates into polar coordinate to be able to use the Gcode which it would be sent as ‘grbl way’ to our microcontroller to move as we planed.
we found this formela on the internet:
by this, we could done from gcode generating by our website using only JavaScript.