Categories
Uncategorized

Code diggin’

So –

After TOM gave me the starting code on how to implement Drawbot on  my creation, (thanks for the phone support ! Like !) I started digging into the code – generally understanding there are 3 parts:

  • Java – Runs on the PC and load G-code drawings  into the system
  • G-Code – The actual code that says the Drawbot where to move to
  • Firmware – The code that runs in the Arduino, and operates the motors

I found that the parts that needed to be changed are the Arduino (since I am not using Adafruit’s Stepper shield, but Pololu’s driver) which is a bit different.

beside that I need to insert the physical dimensions of my system and then to compile and run the code. Sounds easy hope it will be that way.

code

So I found the CORE:

The original code is calling an Adafruit’s motor shield (arduino.ino):
static AF_Stepper m1((int)STEPS_PER_TURN, M2_PIN);
        static AF_Stepper m2((int)STEPS_PER_TURN, M1_PIN);

and then gives orders to one of the motors:
m2.onestep(dir2);
m1.step(1,M1_REEL_OUT);

I need to replace the motor commands by simple orders to the motors (digital out 1 or 0 for direction and 1 for step) that will use the same parameters as the Adafruit’s functions.
that will make the code shorter, thinner and without hassle

One reply on “Code diggin’”

Leave a Reply

Your email address will not be published. Required fields are marked *