Skip to content

kigster/BattleShift

Repository files navigation

BattleShift

NOTE: This project and its README were auto-generated using

  • arli Arduino toolkit, and using the generate command. Thank you for using Arli!
  • arli-cmake is the template project that was used as a source for this one.
  • arduino-cmake is the CMake-based build system for Arduino projects.

There is a discussion board for Arli/CMake-based projects. Please join if you have any questions or suggestions! Gitter

Overview

This Arduino project uses CMake build system, and the Arduino-CMake project. It also uses arli CLI tool to manage it's library dependencies.

Usage

Prerequisites

  • On a Mac, you always need to run xcode-select --install before you can do any development. You must have git installed;

  • Requires CMake

  • Requires Arduino IDE or an SDK, either for Mac or Linux installed;

  • Requires ruby, 2.3 or 2.4+ installed. On a Mac's Terminal, run ruby --version. If for some reason you don't have it installed, the bin/setup script will prompt you to install it.

Building

You can build the project using provided BASH helpers:

$ cd ~/workspace/BattleShift
$ bin/setup
$ bin/build

Or you can build manually using cmake/make:

$ cd ~/workspace/BattleShift
$ rm -rf build && mkdir build
$ cd build
$ cmake ..
$ make                          # this builds the image
$ make upload                   # this uploads it to the device
$ # this next command opens a serial port monitor inside a screen session
$ make BattleShift-serial

Customizing the Build

You can use environment variables to set the board, CPU and the port. Simply prefix the following variables before you run cmake ..

$ rm -rf build && mkdir -p build && cd build
$ BOARD_NAME=nano \
  BOARD_CPU=atmega328p \
  BOARD_DEVICE=/dev/tty.usbserial-DA00WXFY \
  cmake ..

Adding External Libraries

Your repo contains Arlifile (which is a YAML file) inside the src folder. Please read the documentation about the format of Arlifile.

Go ahead and edit that file, and under dependencies: you want to list all of your libraries by their exact name, and an optional version.

The best way to do that is to first search for the library using the arli search terms command. Once you find the library you want, just copy it's name as is into Arlifile. If it contains spaces, put quotes around it.

For example:

$ arli search /adafruit.*bmp085/i

Arli (1.0.2), Command: search
Library Path: ~/Documents/Arduino/Libraries

Adafruit BMP085 Library                         (1.0.0)    ( 1 total versions )
Adafruit BMP085 Unified                         (1.0.0)    ( 1 total versions )
———————————————————————
  Total Versions : 2
Unique Libraries : 2
———————————————————————

If the library is not in the official database, just add it with a name and a url, and an optional sub-folder. Arli will use the url field to fetch it.

To verify that your Arlifile can resolve all libraries, please run arli bundle inside the src folder. If Arli succeeds, you've got it right, and the libraries folder inside src should contain all referenced libraries.

Adding Source Files

You will notice that inside src/CMakeLists.txt file, there is a line:

set(PROJECT_SOURCES BattleShift.cpp)

If you add any additional source files or headers, just add their names right after, separated by spaces or newlines. For example:

set(PROJECT_SOURCES
  BattleShift.cpp
  BattleShift.h
  helpers/Loader.cpp
  helpers/Loader.h
  config/Configuration.h
)

The should be all you need to do add custom logic and to rebuild and upload the project.

Where to get Support?

Please feel free to file bug reports and submit pull requests on GitHub — https://github.com/kigster/arli-cmake is the project URL, and this is the issues URL.

License

The original project is distributed as open source, under the terms of the MIT License.

However, feel free to change the license of your project, as long as you provide the credit to the original.

Thanks! Good luck!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors