Hello guys, wonder if someone can give me some help with the principles of codding for my project?
I have two stepper motors being controlled though L293D Stepper Motor Driver to plot an axis on my vertical plotter.
I see there are many vector fonts and images i could send to the motors though C or arduinon sketches but am a little lost how to go about this?
could someone do me a huge favour and just point me in the right direction as the only example code fr something similar is in PHP in this stunning project Sprites mods - Online whiteboard - Hardware: motors ?
The article says that (s)he's using an entire PC to convert the font characters to the X/Y motions needed to actually draw them on the whiteboard; you aren't going to be able to do that on an Arduino, which doesn't have anywhere NEAR the computing power.
If you're just looking to use an Arduino as the basis for their plotter-innards hardware hack, that's do-able; just have a look at the source code they made available via a link in the article to get some idea of what you need to do/change.
The article says that (s)he's using an entire PC to convert the font characters to the X/Y motions needed to actually draw them on the whiteboard; you aren't going to be able to do that on an Arduino, which doesn't have anywhere NEAR the computing power.
I appreciate what your saying, but the plant was to have a computer do all the calculation, then simply load the x/y or algorithm onto the Arduino so the the Arduino can print the reliant information in multiple places unattached to the pc.
Much in the same way i would assume this Arduino Etch-A-Sketch clock is programmed.
It is a simple matter of Pythagoras. Let your pen be at point P and motors at A & B separated by a length L. Draw this upside down with A on the left B on the right and P some point above the two.
You need to find two quantities the length AP and the length BP, given a value of X and Y (the Cartesian coordinates of the pen P).
So from the diagram you will see that AL is given by the square root of X squared plus Y squared. And the length BL is given by the root of (L-X) squared plus Y squared.
So to move to any point with a straight line make sure your motor produces the right number of steps to adjust both strings in the same unit of time.
Curves are simply lots of straight lines. Look up "Parametric curves" for information on splines but they all boil down to straight lines.
I am not sure what you mean by "vector image" but if it is the output from a vector drawing package then you have to either interpret the vector format directly or get the application to output it in a format you can interpret.
A simple and popular one is HPGL2, although you probably will not have enough room to do that in an Arduino.
thanks for the link, but unfortunately Hector is not open source and i have contacted Jürg Lehni, the creator of "Scriptographer" the java app that translates the image from illustrator in motor commands, but have not received a response in several weeks.
this is unfortunate as the Scriptographer Hector program is exactly what im after. Adobe Illustrator to wall
You just have to parse the input and convert it into X & Y moves and draws. As I said it is probably best to do it in the PC and just transfer the basic X & Y to the arduino and let it draw it. There are lots of commands but in practice only a few are used.