Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Bespoke, artisinal, Precompiler In ZZee Air
: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:
Compile Arduino sketches within a web browser environment (coming soon) :zap:
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:
npm install avr-pizza
To compile a simple sketch with no custom library dependencies (such as blink.ino):
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:
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):
'/Applications/Arduino.app'
'/usr/local/share/arduino-1.6.9'
'c:\\Program\ Files\\Arduino'
Example:
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:
String sketch - the local path to the sketch file you're looking to compile
String board - the target Arduino board the sketch is to be compiled for. See the supported boards section in this documentation to look up the correct string to supply for your chosen board.
Array libraries - contains local directory paths to any library your sketch uses (optional). Standard Arduino libraries do not need to be included. See standard libraries section in this documentation for the list.
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' }
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:
npm install -g avr-pizza
avr-pizza compile -s <sketch filepath> -l <library dirpath> -a <arduino name> [-o <output path> -b <local IDE path>]
You may repeat the -l
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.
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 |
Arduino Mega | mega |
Arduino Leonardo | leonardo |
Arduino Micro | micro |
Arduino Nano | nano |
Arduino Duemilanove | diecimila |
Arduino Yún | yun |
Arduino Pro | pro |
Arduino Mega | ADKmegaADK |
Arduino Esplora | esplora |
Arduino Mini | mini |
Arduino Ethernet | ethernet |
Arduino Fio | fio |
Arduino BT | bt |
LilyPad Arduino USB | LilyPadUSB |
LilyPad Arduino | lilypad |
Arduino NG | atmegang |
Arduino Robot Control | robotControl |
Arduino Robot Motor | robotMotor |
Arduino Gemma | gemma |
There is no need to include the standard libraries that ship with Arduino. To rejog your memory, they are:
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.
FAQs
bespoke, artisinal, avr-gcc precompiler in zzee air
The npm package avr-pizza receives a total of 0 weekly downloads. As such, avr-pizza popularity was classified as not popular.
We found that avr-pizza demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.