Software to Develop Software

This will be a bit of a niche pitting. If you have no idea what I’m talking about, move along.

I’m working on a project. I’ve build a rig in which I can mount an Etch-A-Sketch with the knobs connected by gears to two stepper motors. The stepper motors are connected to an Arduino microcontroller. Ideally, I’ll be able to control the Etch-A-Sketch with excellent precision, drawing anything that I can program with a series of XY coordinates.

Things like this never seem to go simply. The company I ordered the motors from sent the wrong size screws for connecting the motors to the mounts, that sort of thing. But I think all the hardware issues are behind me. I’ve had it running and drawing some simple figures. Results were promising.

And so I got to the point of really developing the code. As I said, I had simple commands working; but there are pieces of the code that I’d like to make reusable. Software developers would call that a library. If I want to draw different things, I can just code the specific coordinates, pass those numbers to functions within the library, and be happy.

Software developers use software to develop software. I need something that can edit text, confirm that the text is a valid program, and upload it to the microcontroller. None of those seem like they would be pushing the bleeding edge of what software can accomplish. Little did I know.

First I tried the native Arduino IDE. Worked for the small test program; is infuriating for anything more. “You want to edit a file that ends in .h, are you mad?” I still may end up using it to build and upload, I’ll just have to edit the library files somewhere else. Still, what the fuck?

So I searched online for other IDEs, (an Integrated Development Environment). Found one called MariaMole that looked promising. It acknowledges the existence of other file extensions, as long as they’re exactly where it expects them to be. Start a new project, and it copies everything related to it to a new directory, which sort of negates the reason for using one library shared by multiple projects. Close a project, and it not only closes it, it deletes everything from the disk.

Found one called UECIDE. When I try to open a file, it crashes. Turns out it actually wanted me to open a directory. It’s looking for a directory that contains a .ino file. If you have subdirectories there that contain .ino files you want to open? Forget it, you can’t get to them; it finds that highest level .ino and assumes that’s the one you want.

Not only are these things fucking broken, they’re fucking broken when doing fucking simple shit.

Does anyone make a tool for this that doesn’t fucking suck?

I feel your pain. However I don’t know anything about the Arduino environment. I assume you are looking for an IDE that runs on a host machine and uploads compiled code to the Arduino. Are you working through an API to these IDEs? If there are calls into the IDE to import code, compile it and report errors, and upload the compiled code to the device you should be able to customize something like Java Eclipse, or an use an application you create yourself in any language to directly call the API. Of course you’ll want some IDE specifically for Arduino, but if you can’t get what you want then I’m sure you’re not going to give up at this point.

I’m a little unclear on how the standard IDE doesn’t allow you to create libraries. How much code do you have to create? Does this have to be a highly code driven control package as opposed to data driven because of Arduino limitations?

This was supposed to be just a simple project; a couple motors, a controller, and some code. Writing my own development environment is not what I was hoping to get out of it, especially when there are tools that claim to already do it. There are more that I haven’t tried yet, but I’m amazed at how bad the ones I have tried are.

The editor automatically adds a .ino extension to every file you edit. It may require a .ino extenstion to open a file; not sure on that.

There is a possible workaround; I can edit the files in one IDE (or even Notepad, if it comes to that), and build and upload in another. But c’mon folks, mandatory file extensions? I started looking for an alternative because I thought they couldn’t all be that stupid. The ones I’ve tried were worse.

There is an Eclipse plugin for Arduino: http://www.baeyens.it/eclipse/

Haven’t tried that one yet. Is it any good?

You could try to use something else as a springboard, for example a RepRap RAMPS 3D printer control board and source code; I would be very surprised if someone hasn’t used it to create a plotter yet, which is pretty much what you want to accomplish.

I haven’t tried the Arduino plugin (haven’t done any coding for an Arduino in a while), but I like Eclipse in general, and the plugin page says it gives you access to the library code. That probably means it would be easier to add your own library with it.

Be aware that Eclipse is a pretty powerful and flexible IDE, used for programming in lots of languages…which means it has a ton of stuff you don’t need for this, and may have a substantial learning curve. There should be plenty of tutorials out there, though, if you need them.

The microcontroller doesn’t connect directly to the motors, though. There’s a separate board that fits on top of the Arduino, and has connections that handle the motor current. Finding one of those that could handle two motors simultaneously was a little tricky. And I’m using libraries that were written to work with that motor controller.

So yeah, it’s the same basic task as controlling a plotter or 3D printer, but the code probably isn’t written for the same hardware I’m using.

I’m trying it now. It ain’t the most user-friendly thing in the world, but at least I haven’t found anything fundamentally broken about it. Yet.

It beats vi. (And yes, I have recently written code in vi. Fortunately, not much–just a small, but terribly convoluted, script.)

The RAMPS board is a shield for an Arduino… Uno, I think, it comes with four sockets for tiny (and very cheap) stepper control modules, they are good up to a NEMA17s.

Aww, I like vi…but Eclipse was the second thing I thought of when I read the OP. :smiley:

If I’d found that first, maybe I’d have gotten it instead of the board I did. Still not sure it would have solved this particular problem.

If you’re not one of those anti-Microsoft guys, you could try Visual Studio with an Arduino plugin. Lots of stuff came up when I googled 'Arduino “visual studio”.

With Eclipse you can always customize it and adapt it to your needs if it’s not doing what you want initially. That isn’t always easy, but likely easier than modifying something like MS Studio.

I use the Visual Micro plugin. It has it’s own annoyances, but isn’t bad.

Probably not solved your problem, but you may want to still check at least on the stepper drivers used by that board, the A4988 StepStick (and myriad clones), you can use them independently of a shield, connected directly to two pins, one for direction and one for step;they are so cheap they’ll make you feel guilty of buying them, you can find them for less than two bucks for each board.

I haven’t even powered my Arduino up yet so I’m just spitballing here, but a Google search for ‘Arduino Plotter’ returns pages of results of projects and code resources. You should be able to grab something that will accept standard vector files and draw them out.

Just remembered… Arduino / Etch-a-Sketch Clock

Good luck!

vi is pretty awesome.

Progress, but it’s like swimming through cement. I found a couple tutorials about setting up Eclipse to work with Arduino; they don’t agree with each other, and neither agrees with what I see on my local machine. I did get a project created. I couldn’t set it to work on an Arduino Uno (that wasn’t an option), and when I try to verify a sketch (which worked in the Arduino IDE) it can’t find the “make” executable. I’m not sure which “make” it wants, where I was supposed to have gotten it, and where it should be in my installation.

We’ve had computers for a number of years now. Doesn’t anybody make anything that just fucking works?