bespoke, artisinal, avr-gcc precompiler in zzee air
npm install avr-pizza!status not ready !powered by Azure
:cloud: :pizza: :cloud: :pizza: :cloud:
:warning: This is very much in alpha stage at the moment, so use at your own caution. Holler in this repo's issues if you have something unexpected happen if you give this a try. Thanks :pray: :two_hearts:
Avr-pizza is a tool for compiling Arduino sketch files without needing to have the Arduino IDE and related toolchains installed on your machine.
It makes use of :sparkles: the cloud :sparkles:. Ask, and ye shall receive a freshly baked, delicious compilation in a timely manner.
A: Glad you asked! A couple of general use cases for leaning on remote compilation:
1. Compile Arduino sketches within a web browser environment (coming soon) :zap:
2. Compile Arduino sketches on users' machines without requiring them to go through downloading and installing the Arduino IDE. This is particularly helpful for nodebots related libraries, which often produce custom sketches tailored to the unique needs of a user setting up their robot. Makes for a less confusing and more friendly 'out of the box' experience all round.
A: Yes! See the examples section of this README for details on how to do this.
To use this library, a stable internet connection is required. You'll also need to have NodeJS installed on your computer.
First, ensure you have installed NodeJS.
Then, run the following in your preferred terminal program:
``bash`
npm install avr-pizza
To compile a simple sketch with no custom library dependencies (such as blink.ino):
`js
var avrpizza = require('avr-pizza');
var package = {
sketch: '/path/to/blink.ino',
board: 'uno'
};
avrpizza.compile(package, function(error, hex) {
console.log(error, hex); // hex = NodeJS Buffer containing hex file contents
});
`
Note: hex is a NodeJS Buffer. You may then go on to pass this onto your program, or even write it to disk as a .hex file.
To compile a sketch with custom library dependencies, a libraries option is needed containing the paths to the top level directory of each library:
`js
var avrpizza = require('avr-pizza');
var package = {
sketch: '/path/to/mysketch.ino',
libraries: ['/path/to/customlib1', '/path/to/customlib2'],
board: 'uno'
};
avrpizza.compile(package, function(error, hex) {
console.log(error, hex);
});
`
Currently, local builds are supported on OSX, Linux, and Windows.
To compile locally, add a builder option to your package object. The location key should be set to the path where your local installation of the Arduino IDE is located.
Typical installation locations (adjust accordingly - your installation path might differ slightly):
+ OSX: '/Applications/Arduino.app''/usr/local/share/arduino-1.6.9'
+ Linux: 'c:\\Program\ Files\\Arduino'
+ Windows:
Example:
`js
var avrpizza = require('avr-pizza');
var package = {
sketch: '/path/to/mysketch.ino',
libraries: ['/path/to/customlib1', '/path/to/customlib2'],
board: 'uno',
builder: {
location: '/Applications/Arduino.app'
}
};
// avrpizza will now build using /Applications/Arduino.app
avrpizza.compile(package, function(error, hex) {
console.log(error, hex);
});
`
You may include the following options in the package object passed to the compile method:
+ _Object_ builder - the location of your local installation of the Arduino IDE, only if you wish to compile locally. Contains one key - location which should be a path string of where the IDE is located on your hard drive. Eg: builder: { location: '/Applications/Arduino.app' }CLI
Avr-pizza is also a command line tool! Run it on a sketch and a hex file will be saved to disk.
Install it with:
`bash`
npm install -g avr-pizza
`bash`
avr-pizza compile -s -l
You may repeat the flag as many times as necessary to supply all the library directory paths you need.
-o is optional; if not supplied the hex file will be saved in the current directory.
#### Example
`bash`
avr-pizza compile -s /path/to/mysketch.ino -l /path/to/cool/library/dir -a 'uno' -o ~/stuff/pizzas
|Board Name|Option String|
|:----------|:--------------|
|Arduino Uno|uno|mega
|Arduino Mega||leonardo
|Arduino Leonardo||micro
|Arduino Micro||nano
|Arduino Nano||diecimila
|Arduino Duemilanove||yun
|Arduino Yún||pro
|Arduino Pro||ADKmegaADK
|Arduino Mega||esplora
|Arduino Esplora||mini
|Arduino Mini||ethernet
|Arduino Ethernet||fio
|Arduino Fio||bt
|Arduino BT||LilyPadUSB
|LilyPad Arduino USB||lilypad
|LilyPad Arduino||atmegang
|Arduino NG||robotControl
|Arduino Robot Control||robotMotor
|Arduino Robot Motor||gemma
|Arduino Gemma||
There is no need to include the standard libraries that ship with Arduino.
To rejog your memory, they are:
+ EEPROM - reading and writing to "permanent" storage
+ Ethernet - for connecting to the internet using the Arduino Ethernet Shield
+ Firmata - for communicating with applications on the computer using a standard serial protocol.
+ GSM - for connecting to a GSM/GRPS network with the GSM shield.
+ LiquidCrystal - for controlling liquid crystal displays (LCDs)
+ SD - for reading and writing SD cards
+ Servo - for controlling servo motors
+ SPI - for communicating with devices using the Serial Peripheral Interface (SPI) Bus
+ SoftwareSerial - for serial communication on any digital pins.
+ Stepper - for controlling stepper motors
+ TFT - for drawing text , images, and shapes on the Arduino TFT screen
+ WiFi - for connecting to the internet using the Arduino WiFi shield
+ Wire - Two Wire Interface (TWI/I2C) for sending and receiving data over a net of devices or sensors.
If the only libraries you make use of in your sketch are included in the list above, you may leave out the libraries key in your avrpizza.compile` package options.
MIT
You may read this software's privacy policy.