Arduino Forum

Topics => Robotics => Topic started by: hinge on Nov 11, 2012, 06:13 pm

Title: Drawing bot - from the beginning (maybe again)
Post by: hinge on Nov 11, 2012, 06:13 pm
Hi there

I need to ask...
I have together with my son made a X-Y table from old CD players hooked it up with two L293 - that works fine. Now coding drawings are (I know) non trivial. So I ran into some challenges. I am using the stepper libery for controlling (I might make my own one day)

1) Have any one made liberies for drawing normal stuff like Squares, triangles and circles?
2) I would like to send commands from a Lazarus (or like) program running on a com. thus make a call to my arduino like: draw(x,y), move(x,y) So then I can make the drawing in my own program and the Arduino do not have to have ALL commands for the drawing at once. I would like to send them one by one (I know inefficient - but I need it for other projects - my drawing is only a playground project)

By the way I am a newbe (have had it for 2 weeks by now) - so please bring examples.

I know RS232 com with other equipment and run the comport routinely But not with the arduino).

Yours
Moose
Title: Re: Drawing bot - from the beginning (maybe again)
Post by: PaulS on Nov 11, 2012, 07:52 pm
Quote
1) Have any one made liberies for drawing normal stuff like Squares, triangles and circles?

Lots of libraries exist, but, rather than inventing a new one, a open source CAD/CAM application that can output M and G codes would be a better choice, in my opinion.

Then, read the M and G code file, and send appropriate move instructions to the Arduino.

Quote
2) I would like to send commands from a Lazarus (or like) program running on a com. thus make a call to my arduino like: draw(x,y), move(x,y) So then I can make the drawing in my own program and the Arduino do not have to have ALL commands for the drawing at once.

"Running on a com"?

It's good that the Arduino doesn't need all the commands at once, because it doesn't have near enough memory for any but the simplest programs.

Quote
I would like to send them one by one (I know inefficient - but I need it for other projects - my drawing is only a playground project)

Perhaps you are not aware that that is how most CNC machines are driven - one instruction at a time.

Title: Re: Drawing bot - from the beginning (maybe again)
Post by: Chagrin on Nov 12, 2012, 06:40 am
Adafruit-GFX-Library (https://github.com/adafruit/Adafruit-GFX-Library/blob/master/Adafruit_GFX.cpp) has a number of basic drawing primitives; it's designed for an LCD screen but it'd give you a jumpstart on developing a library for your bot.
Title: Re: Drawing bot - from the beginning (maybe again)
Post by: justone on Nov 12, 2012, 09:33 pm
I'm slowly getting a 3 axis mill going and came across an open source program for it. Take a look and see if it can be of any help to you.

https://github.com/grbl/grbl