Coder Social home page Coder Social logo

genau's Introduction

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

genau's People

Contributors

ertdfgcvb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

st01c lymanzhang

genau's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.