Giter VIP home page Giter VIP logo

rake-arduino's Introduction

rake-arduino

A Flexible build tool for Arduino development

Usage

rake-arduino is very pre-alpha at the moment. Be prepared to find and fix a lot of bugs while using it.

After installing the gem (see below), simply add a Rakefile that looks like this to the root of your project:

require 'rubygems'
require 'rake/arduino'

Rake::Arduino::Sketch.new do |s|
  s.sources << "MySketch.cpp"
  s.libraries << "Servo"

  s.board = Rake::Arduino::Board["Arduino Uno"]
end

See the examples directory for more advanced usage.

Then, to build your project run:

rake

To upload it to your arduino:

rake upload

If your arduino installation is somewhere non-standard, you'll need to configure that at the top of your Rakefile:

Rake::Arduino.configure do |c|
  c.home = "/home/me/apps/arduino-0022"
end

Installation

You'll need ruby and rubygems installed (use your system's package manager, or RVM).

As a gem:

gem install rake-arduino

From source:

gem install bundler rake

git clone https://github.com/wjbuys/rake-arduino
cd rake-arduino
rake install

Background

Arduino is great. The arduino IDE: not so great. Once your project moves beyond a nontrivial size, it's a massive pain to use. Sorry Arduino team, but it's just painful and ugly (and stupid, if you're used to Vim/Emacs).

At this point all the gurus say: "Just use a Makefile!". Unfortunately, this becomes a very roll-your-own mission (there's no centrally maintained version).

Also, the Makefile syntax makes my eyes bleed. Inevitably multiple copies of the same Makefile with minor tweaks will end up around all my projects, because I'm lazy.

Luckily, there's a solution: Rake. Rake is Ruby, so

  1. the syntax is gorgeous,
  2. you get a real programming language to do additional pre-processing,
  3. and you can wrap common logic up neatly into a central library.

TODO

  1. Support .pde sketch pre-processing
  2. Add some specs (I just ripped this out of a project I was working on, so no tests :( )
  3. Support config from ~/.rake-arduino

rake-arduino's People

Contributors

wjbuys avatar

Watchers

 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.