Skip to content

Commit b9b069a

Browse files
committed
Initial Experimental Release
RX only support for broadcast data Tx to follow shortly
1 parent 5616afc commit b9b069a

File tree

3 files changed

+63
-29
lines changed

3 files changed

+63
-29
lines changed

README.md

Lines changed: 58 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,69 @@ Arduino library for communicating with ANT radios, with support for nrf51 device
88

99
## News
1010

11+
* 06/08/2016 Initial Experimental Rx only release
1112
* 04/21/2016 Project forked from Andrew Wrapp xbee-arduino
1213

13-
## Documentation
14-
Doxygen API documentation is available in the downloads. Unfortunately it is not available online anymore as Git does not support the html mime type as Subversion does
15-
16-
[Developer's Guide](https://github.com/cujomalainey/ant-arduino/blob/wiki/DevelopersGuide.md)
14+
[Developer's Guide](https://github.com/cujomalainey/ant-arduino/wiki/Developer's-Guide)
1715

1816
## Example
19-
I have created several sketches of sending/receiving packets with NRF51 ANT radios. You can find these in the examples folder. Here's an example of sending a packet with a NRF51 radio:
17+
I have created several sketches of sending/receiving packets with NRF51 ANT radios. You can find these in the examples folder. Here's an example of configuring a channel with a NRF51 radio:
2018

2119
```
2220
// Create an ANT object at the top of your sketch
2321
ANT ant = ANT();
2422
2523
// Start the serial port
2624
Serial.begin(9600);
27-
// Tell XBee to use Hardware Serial. It's also possible to use SoftwareSerial
25+
// Tell ANT to use Hardware Serial. It's also possible to use SoftwareSerial
2826
ant.setSerial(Serial);
2927
30-
// Create an array for holding the data you want to send.
31-
uint8_t payload[] = { 'H', 'i' };
32-
33-
// Specify the address of the remote XBee (this is the SH + SL)
34-
XBeeAddress64 addr64 = XBeeAddress64(0x0013a200, 0x403e0f30);
35-
36-
// Create a TX Request
37-
ZBTxRequest zbTx = ZBTxRequest(addr64, payload, sizeof(payload));
38-
39-
// Send your request
40-
ant.send(zbTx);
28+
AssignChannel ac;
29+
ResetSystem rs;
30+
SetNetworkKey snk;
31+
ChannelId ci;
32+
ChannelPeriod cp;
33+
ChannelRfFrequency crf;
34+
OpenChannel oc;
35+
36+
// Set Network Key, defaults to public, if you want the ANT+ key you need to get it from thisisant.com, DO NOT PUBLISH IT
37+
snk = SetNetworkKey();
38+
snk.setNetwork(0);
39+
snk.setKey((uint8_t*)NETWORK_KEY);
40+
ant.send(snk);
41+
42+
// Assign the channel and its type
43+
ac = AssignChannel();
44+
ac.setChannel(0);
45+
ac.setChannelType(0);
46+
ac.setChannelNetwork(0);
47+
ant.send(ac);
48+
49+
// Assign the Channel IDs (these are all wildcarded values) (if you are using ANT+ see the profile for settings)
50+
ci = ChannelId();
51+
ci.setChannel(0);
52+
ci.setDeviceNumber(0);
53+
ci.setDeviceType(0);
54+
ci.setTransmissionType(0);
55+
ant.send(ci);
56+
57+
// Set the channel period (if you are using ANT+ see the profile for settings)
58+
cp = ChannelPeriod();
59+
cp.setChannel(0);
60+
cp.setPeriod(1111);
61+
ant.send(cp);
62+
63+
crf = ChannelRfFrequency();
64+
crf.setChannel(0);
65+
crf.setRfFrequency(0);
66+
ant.send(crf);
67+
68+
// open the channel
69+
oc = OpenChannel();
70+
oc.setChannel(0);
71+
ant.send(oc);
72+
73+
// Wait for the responses
4174
```
4275

4376
See the examples folder for the full source. There are more examples in the download.
@@ -46,11 +79,11 @@ To add XBee support to a new sketch, add "#include <ANT.h>" (without quotes) to
4679

4780
## Hardware
4881

49-
For development and general tinkering I highly recommend using an Arduino that has 2 serial ports, such as the Arduino Leonardo. The reason is the ANT Radio requires serial port access and it is useful to have another serial port available for debugging via the Arduino serial console.
82+
For development and general tinkering I highly recommend using an Arduino that has 2 serial ports, such as the Arduino Leonardo. The reason is the ANT Radio requires serial port access and it is useful to have another serial port available for debugging via the Arduino serial console. Also it is easier to use a 3.3V arduino than to use a level shifter
5083

51-
* Arduino Leonardo (recommended)
52-
* Arduino UNO R3 (single serial port)
53-
* Arduino Pro (single serial port)
84+
* Teensy 3.2
85+
* Pro Mini 3.3V
86+
* Trinket 3.3V
5487

5588
ANT radios come in multiple models, but this driver is designed to only support the following:
5689

@@ -63,24 +96,24 @@ You will need 3.3V regulator and logic shifting to convert from 5V (Arduino) to
6396
## Installation
6497
Arduino 1.5 and later
6598

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

68101
Prior to Arduino 1.5 installation is a manual
69102

70103
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.
71104

72105
## Uploading Sketches
73106

74-
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 UNO, 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.
107+
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.
75108

76109
## Configuration
77110

78-
To use this library your ANT radio must be loaded with the ANT Network Processor firmware.
111+
To use this library your ANT radio must be loaded with the ANT Network Processor firmware. See Wiki for recommended wiring.
79112

80113
## Questions/Feedback
81114

82115
Questions about this project should be posted to http://groups.google.com/group/ant-api?pli=1 Be sure to provide as much detail as possible (e.g. what radios, firmware versions, configuration and code).
83116

84117
## Consulting/Commercial Licenses
85118

86-
If you are looking for commercial support go to thisisant.com
119+
If you are looking for commercial support for the radios go to thisisant.com, for the driver please email me.

src/ANT.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
22
* Copyright (c) 2009 Andrew Rapp. All rights reserved.
3+
* Update by Copyright (c) 2016 Curtis Malainey
34
*
45
* This file is part of Ant-Arduino.
56
*
@@ -9,8 +10,8 @@
910
* (at your option) any later version.
1011
*
1112
* Ant-Arduino is distributed in the hope that it will be useful,
12-
* but WITHOUT ANY WARRAntY; without even the implied warranty of
13-
* MERCHAntABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1415
* GNU General Public License for more details.
1516
*
1617
* You should have received a copy of the GNU General Public License

src/ANT.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
* (at your option) any later version.
1111
*
1212
* Ant-Arduino is distributed in the hope that it will be useful,
13-
* but WITHOUT ANY WARRAntY; without even the implied warranty of
14-
* MERCHAntABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1515
* GNU General Public License for more details.
1616
*
1717
* You should have received a copy of the GNU General Public License

0 commit comments

Comments
 (0)