Giter Site home page Giter Site logo

ever-never / antplus-arduino Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cujomalainey/antplus-arduino

0.0 0.0 0.0 1.07 MB

An Implementation of the ANT+ Network on top of ant-arduino

License: GNU General Public License v2.0

C++ 90.05% C 9.95%

antplus-arduino's Introduction

antplus-arduino

An Implementation of the Ant+ Network on top of ant-arduino

Status

Build and Tests

Roadmap

  • Build support for non-ANT+ channel interfacing
  • Adding more profiles

Developer's Guide

Example

I have created several sketches of configuring the radio with the ant-arduino library. You can find these in the examples folder. Here's an example of configuring a channel with a NRF51 radio:

AntWithCallbacks ant = AntWithCallbacks();
AntPlusRouter router = AntPlusRouter();
ProfileHeartRateMonitor hr = ProfileHeartRateMonitor(WILDCARD_DEVICE);

void previousHeartBeatDataPageHandler(HeartRatePreviousHeartBeat& dp, uintptr_t data) {
    Serial.print("HR: ");
    Serial.println(dp.getComputedHeartRate());
}

void setup() {
    Serial1.begin(BAUD_RATE);
    ant.setSerial(Serial1);
    delay(10000);

    router.setDriver(&ant); // never touch ant again
    router.setAntPlusNetworkKey(NETWORK_KEY);
    router.setProfile(CHANNEL_0, &hr);
    // Delay after initial setup to wait for user to connect on serial

    Serial.begin(BAUD_RATE);
    Serial.println("Running");
    hr.onHeartRatePreviousHeartBeat(previousHeartBeatDataPageHandler, NULL);
    hr.begin();
    // wait for pair to complete
    hr.waitForPair();
}

void loop() {
    router.loop();
}

See the examples folder for the full source. There are more examples in the download.

To add ANT support to a new sketch, add "#include <ANTPLUS.h>" (without quotes) to the top of your sketch. You can also add it by selecting the "sketch" menu, and choosing "Import Library->ANT+".

Hardware

See ant-arduino

Support ANT+ Profiles

This library aims to support all ANT+ devices. This goal will take time but its an attainable one. Check out the wiki for the list of profiles implemented and their versions.

Installation

Note: This library depends on ant-arduino. You must have it installed for it to work. If you are using platformio you don't have to worry about this.

Arduino 1.5 and later

Arduino now includes a library manager for easier library installation. From the Sketch menu select include library->Manage Libraries, then type "antplus-arduino" in the filter and install.

Prior to Arduino 1.5 installation is manual

Download a .zip or .tar.gz release from github. Determine the location of your sketchbook by selecting "preferences" on the Arduino menu. Create a "libraries" folder in your sketchbook and unzip the release file in that location.

If you are using platformio you can install the library by running platformio lib install 1879

Uploading Sketches

Uploading sketches with a Leonardo is as simple as connecting the Arduino to your computer and uploading. When using a single serial port Arduino, such as the Pro Mini (3.3V), the jumpers on the ANT Radio must be disconnected. Then, after upload, reconnect the lines to have access to the serial port. Always remember to power off the Arduino before moving the jumpers.

Configuration

See ant-arduino

Questions/Feedback

Questions about this project should be posted to Github Discussion. Be sure to provide as much detail as possible (e.g. what radios, firmware versions, configuration and code).

Consulting/Commercial Licenses

At the current time there is zero support for commercial usage. Contact me via email if you are looking to use this code commercially.

If you are looking for commercial support for ANT radios go to thisisant.com

NOTE: This library is not ANT+ certified and does not intend to be. It is meant to be tool to get quick and easy access to sensors in the ANT+ network. There are edge cases where it will fail to meet the spec of the ANT+ protocol.

antplus-arduino's People

Contributors

cujomalainey avatar sepp62 avatar sporkfly avatar cfournel avatar junollyli 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.