Coder Social home page Coder Social logo

sendg's Introduction

/*
 * sendg.cs
 * Send gcode to Ultimaker via serial port.
 * (c) 2011 Peter Brier. pbrier.nl - gmail.com
 *
 * Requires Mono or MS C# to compile (mono-gmcs is only required to compile). For example:
 * # sudo apt-get install mono-gmcs mono-gac mono-utils
 * # gmcs sendg.cs
 * # mono sendg.exe
 *
 * USE: sendg -d -l -c[buffercount] -p[portname] -b[baudrate] [filename]
 * -d             Enable debugging
 * -l             Enable logging
 * -e             Enable build time estimation
 * -c[n]          Set delayed ack count (1 is no delayed ack)
 * -p[name]       Specify portname (COMx on windows, /dev/ttyAMx on linux)
 * -b[baudrate]   Set baudrate (default is 115200)
 * [filename]     The GCODE file to send
 * 
 * Best results are obtained when c>3, however, your firmware serial buffer should be large 
 * enough to hold all these lines
 *
 * Two threads are used (a reader and main thread).
 * Note: we do *NOT* use the async events of the SerialPort object.
 * these have 'issues' on mono (one of the 'issues' is that they don't work).
 *
 * Upto "bufcount" lines are sent, before they are ACK-ed
 * A semaphore is used to sync the threads.
 * We assume all these lines fit in the 128 byte serial buffer of
 * the arduino. An optimized version could cound the actual nr of
 * bytes sent and ACKed to sync the reader/writer.
 * No CRC, line-numbers or resents are implemented.
 * Tested with standard ultimaker and sprinter firmware, 
 * using bufcount=2
 *
 * sendg is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * sendg is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with sendg.  If not, see <http://www.gnu.org/licenses/>.
 */

sendg's People

Contributors

pbrier avatar

Watchers

James Cloos avatar  avatar

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.