GithubHelp home page GithubHelp logo

zuluspl0it / arduino-cardinal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from daawesomep/arduino-cardinal

0.0 0.0 0.0 22 KB

An Arduino library that takes input in degrees and output a string or integer for the 4, 8, 16, or 32 compass headings (like North, South, East, and West).

Home Page: https://github.com/DaAwesomeP/arduino-cardinal

License: Apache License 2.0

C++ 100.00%

arduino-cardinal's Introduction

Cardinal

License GitHub release Github Releases Downloads Gitter chat

Cardinal is an Arduino library that takes input in degrees and output a string or integer for the 4, 8, 16, or 32 compass headings (like North, South, East, and West). It also makes available environment variables for the minimum, maximum, and middle azimuth of all of the 32 directions. It works fantastically when paired with a magnetometer.

Installation

Cardinal is currently compatible with both Arduino 1.0.x and 1.5.x.

Via Arduino IDE Library Manager

Cardinal is in the library manager. From the latest version of the Arduino IDE, go to Sketch > Tools > Include Library > Manage Libraries and search and install the latest release version of Cardinal.

Via the ZIP archive

Download the latest release ZIP from here or the latest testing version from here. Then go to Sketch > Tools > Include Library > Add ZIP Library.

Usage

The first thing to do is to include the library in your sketch. Goes to Sketch > Include Library > Cardinal. The example has everything put to use in it, so I would advice looking there too. You should also take a look at the types at the wiki page here.

Cardinal name

This initializes the class and bind it to a name of your choosing. Just use cardinal and make it simple. You will call the other functions with like name.otherFunction. So, if you choose cardinal, then it would be cardinal.otherFunction.

Example:

Cardinal cardinal;

::getInteger(int type, float inputFloat)

This will take the type that you select and an input float in degrees and about a heading by numbers 1 through 32.

Example:

cardinal.getInteger(3, 190.15);
// returns 18

::getString(int type, float inputFloat)

This will take the type that you select and an input float in degrees and about a heading in text format.

Example:

cardinal.getString(3, 190.15);
// returns SbW

Environment Variables

Environment Variables for the integer id, middle azimuth, minimum degrees, and maximum degrees for all 32 headings are available here.

More Information

I found the rainbow compass image and the table of headings on this Wikipedia page very helpful in understand these directions.

arduino-cardinal's People

Contributors

daawesomep avatar per1234 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.