Genau A Processing boilerplate for AxiDraw -------------------------------------------------------------------------------- This is a simple barebone class which wraps the main EiBotBoard commands in a few handy functions without much abstraction. The main reason for this is to facilitate the start of new AxiDraw sketches with a special focus on realtime and interactive projects. The movement and position units are just 1/16 motor steps (Integers) where 80 steps = 1mm. Some timing information is available (TODO). Some boundary checking is done and 'manual reset' methods are provided as well. A dummy port is provided to test the software without the AxiDraw connected. A few helper functions are provided. NOTE: the default settings are for AxiDraw v2 -------------------------------------------------------------------------------- Example G1 - Manual Plotter An example of interactive use of the Control class: use the cursor keys to draw, space to rise / lower the pen at different speeds. -------------------------------------------------------------------------------- Example G2 - Typewriter Use the AxiDraw as a realtime typewriter. -------------------------------------------------------------------------------- Init: Control c = new Control(this); Serial p = c.open(); if (p != null) println("ok!"); -------------------------------------------------------------------------------- The main motion methods: .move(dx, dy) moves the pen by dx, dy steps .moveTo(x, y) moves the pen to x, y assumes a reset has been done .up() raises the pen .down() lowers the pen .off() de-energises the motors to allow manual reset of the pen .zero() sets the zero, aka home .on() energises the motors -------------------------------------------------------------------------------- The main set methods: .motorSpeed(s) sets the motor speed (100..2000) .servoDelay(r, l) sets the delay (in ms) before raising and after lowering of the pen .servo(d, u) sets the down and up values of the servo (1..65535) .readPos() reads the current step positions (via QS) from the board and sets them locally -------------------------------------------------------------------------------- The main get methods: .pos() returns the local positions (int[2]), in steps .x() returns the local x position (int), in steps .y() returns the local y position (int), in steps .idle() returns true if the pen is not moving (works only for one command at a time) .enabled() returns true if the AxiDraw has been manually resetted (default) .pen() returns the pen status (Control.UP or Control.DOWN) -------------------------------------------------------------------------------- The main serial queries: .queryPen() .queryMotor() .querySteps() .version() -------------------------------------------------------------------------------- Helpers: messageLoop() a crappy message sync loop "listener" to throw into Processing’s main draw() loop