You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+58-25Lines changed: 58 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,36 +8,69 @@ Arduino library for communicating with ANT radios, with support for nrf51 device
8
8
9
9
## News
10
10
11
+
* 06/08/2016 Initial Experimental Rx only release
11
12
* 04/21/2016 Project forked from Andrew Wrapp xbee-arduino
12
13
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
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:
20
18
21
19
```
22
20
// Create an ANT object at the top of your sketch
23
21
ANT ant = ANT();
24
22
25
23
// Start the serial port
26
24
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
28
26
ant.setSerial(Serial);
29
27
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)
// 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
41
74
```
42
75
43
76
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
46
79
47
80
## Hardware
48
81
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
50
83
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
54
87
55
88
ANT radios come in multiple models, but this driver is designed to only support the following:
56
89
@@ -63,24 +96,24 @@ You will need 3.3V regulator and logic shifting to convert from 5V (Arduino) to
63
96
## Installation
64
97
Arduino 1.5 and later
65
98
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.
67
100
68
101
Prior to Arduino 1.5 installation is a manual
69
102
70
103
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.
71
104
72
105
## Uploading Sketches
73
106
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.
75
108
76
109
## Configuration
77
110
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.
79
112
80
113
## Questions/Feedback
81
114
82
115
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).
83
116
84
117
## Consulting/Commercial Licenses
85
118
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.
0 commit comments