Step 8Electronics - Arduino
Upload the source code to the arduino. Look at this fine guide courtesy of Adafruit for help.
The code now requires version 1.0 of the Arduino software. If you already use another version of Arduino, go get the new one but install it alongside your existing installation in a separate folder. They are happy to live together. But Arduino 1.0 breaks all your old libraries, so if you want things still to work, keep your old Arduino too.
Because it changes regularly, I have not attached a copy of the code itself to this step, but the very most recent version can be downloaded from the polargraph code repository.
You should save the code file into a new folder inside your arduino sketch folder. Give the new folder the same name as the source code file. So if the file is called polargraph_server_a1.ino, you should create a new folder called polargraph_server_a1 and save the file into it.
It also uses Adafruit's AFMotor library and Mike McCauley's Accelstepper libraries.
The AFMotor library files should be put into a folder called AFMotor inside your Arduino/libraries/ folder.
The Accelstepper library files should be put into a folder called AccelStepper inside your Arduino/libraries/ folder.
Once they are moved, your arduino installation directory should look something like the second image on this page.
Once you do that, you should confirm that it is working properly - use the serial monitor on the board, set to 57600 baud to make sure that it is issuing "READY" every couple of seconds (see the third image).
| « Previous Step | Download PDFView All Steps | Next Step » |
































































Can you update this step as well with more recent info about what code is needed? Step 8 of this Instructable. The link for 'polargraph code repository' is broken.
Is this the main sketch for your machine: polargraphcontroller_zoom.pde ??
I'm going to try to hammer out all the software details before I jump in and start buying all the bits to make this work. I really appreciate how much time and effort you have put into refining this project. Thanks for sharing it with us!
I have a cheap/generic motor shield I got thru eBay, I wonder if AdaFruit's libraries will still work with it. I'll have to try it out I suppose, unless you know if it will work?
There's a lot to digest here, and especially with all of the code files
How do I use all of the PDE files? I thought you can only upload one PDE to the Arduino at a time. Looking at the code, most of them say that they are part of the Polargraph Controller, and have classes and all kinds of other stuff in them. Can you give any quick tips to help me understand how all these files work in the big picture?
Thanks again!
It's been a while since I used the accelstepper drivers on their own, but if I remember right you declare it something like
AccelStepper motorA = new AccelStepper(4, 4,5,6,7);
to specify that you're controlling your stepper hardware with four wires, on arduino pins 4,5,6 and 7.
I did this with another project (http://www.flickr.com/photos/euphy/5942249105/in/set-72157625241383012 - my linear clock that is also on instructables) so it can't be hard if I could figure it out :) The circuit in that picture is two instances of Tom Igoe's stepper driver circuit (http://www.tigoe.net/pcomp/code/circuits/motors/stepper-motors). He uses SN754410s in his diagram, but the pinout is the same on L293Ds. It's not that important which arduino pins you use. The motorshield uses the PWM pins, but that's just for the clever microstepping. If you aren't microstepping, you can use any pin.
Anyway, it seems like the code for the adafruit motor driver doesn't add much, still, if I wanted to take advantage of it, I think I can make my device work the same way.
http://www.ladyada.net/images/mshield/mshieldv1-schem.png