ano
Ano is an Arduino CMake generator.
Last updated 2 years ago by torworx .
MIT · Repository · Bugs · Original npm · Tarball
$ cnpm install ano 
SYNC missed versions from official npm registry.

ano

An arduino library manager and toolchain generator based on CMake developed by NodeJS.

Features

  • Suppose to support all boards that arduino supported including 3rd party ARM boards
  • Config board and port by an interactive command
  • No manual operation required unless you want to
  • No additional cmake file in your project like Arduino CMake
  • Manage 3rd party or own libraries in Bower way
  • No system wide dependencies
  • No dependencies are shared between different apps
  • Using a flat dependency tree model to manage the dependences between libraries
  • Support Arduino type libraries
  • Install library from Git/Github, local file system and an url
  • Manage library version in project scope
  • Support library project including examples targets
  • Using any editor or ide that you like and compile, build and upload with CMake
  • Cross-platform: Windows, Linux, Mac

Requirements

Thanks

I would like to thank all the people that contributed to the following great project:

Installation

> npm i -g ano

Getting Started

The following instructions are for *nix type systems, specifically this is a Linux example.

In short you can get up and running using the following commands:

mkdir build
cd build
cmake ..
make
make upload        # to upload all firmware images             [optional]
make blink-serial  # to get a serial terminal to wire_serial   [optional]

For a more detailed explanation.

1. Initializing firmware project

# Initializing project
$ ano init

Interactively initializing project by select firmware for the first prompt in a empty folder or existing project dir.

When init in an existing project dir, it will skip all existing files and create the necessary files that not exists. So we can apply ano to any existing arduino project easily.

Firmware project structure:

Project
+-- ano.yml
+-- library.json
+-- CMakeLists.txt
+-- <Project>.ino
  • ano.yml is the project user settings file. Boards and Port settings defined in there.
  • library.json is the ano config file to define project's name, version and dependencies.
  • CMakeLists.txt is the cmake main file
  • <Project>.ino it the main ino source file. <Project> name is depended on the parent folder name.

2. Select the board

init command will generate a default ano.yml using current Arduino board and serial port settings. If that is not match the real situation, just run ano config to change it interactively.

3. Creating a build directory

CMake has a great feature called out-of-source builds, what this means is the building is done in a completely separate directory from where the sources are. The benefit of this is you don't have any clutter in your source directory and you won't accidentally commit something that is auto-generated.

So let's create that build directory:

mkdir build
cd build

4. Creating the build system

Now let's create the build system that will create our firmware:

cmake ..

If you rather use a GUI, use:

cmake-gui ..

5. Building

Next we will build everything:

make

6. Uploading

Once everything built correctly we can upload. Depending on your Arduino you will have to update the serial port used for uploading the firmware. To change the port just run ano config to change it interactively.

Ok lets do a upload of all firmware images:

make upload

If you have an upload sync error then try resetting/ power cycling the board before starting the upload process.

NOTE Of cause, you can use any ide as you like, such as CLion (Unfortunately, there is no free version)

Usage

See complete command line reference at Commands and Options

ano support firmware and library project.

A firmware project is the project that contains the main .ino and other .h and .cpp files. ano will generate a upload target for firmware project.

A library project is the project that contains the <Library>.h and all source files. ano will build an examples auto load tool for sub examples folder.

Installing libraries and dependencies

# install dependencies listed in library.json
$ ano install

# install a library and add it to library.json
$ ano install <library> --save

# install specific version of a library and add it to library.json
$ ano install <library>#<version> --save

Using libraries

As soon as creating an ano project, we can use it as a generic cmake project. We can use arduino library as usual.

And also, we can ano install a 3rd party library from git, local or an url to ano_libraries. Use it just in <Project>.ino:

#include <Arduino.h>
#include "Library.h" // The 3rd party library installed by "ano install"

void setup() {
  ...
}

void loop() {
  ...
}

Uninstalling libraries

To uninstall a locally installed library:

# Uninstall library from ano-libraries
$ ano uninstall <library-name>

# Uninstall library from ano-libraries and remove from library.json
$ ano uninstall <library-name> --save

Creating library

Interactively initializing project by select library for the first prompt in a empty folder or existing project dir.

Creating examples of library

  • Create examples folder in library dir if not exists.

  • Create an example folder in examples

  • Create the main ino file with the same name as the parent folder

Finally cmake and make

Resources

Here are some resources you might find useful in getting started.

License

MIT © Yuan Tao

Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 14
Dependencies (20)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |