ertdfgcvb / genau Goto Github PK
View Code? Open in Web Editor NEWA Processing boilerplate for AxiDraw
License: MIT License
A Processing boilerplate for AxiDraw
License: MIT License
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
I had to put SP,1 instead of SP,0 for up position. Are Up/down positions inverted ?
Line 187 in 33a1f0c
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.