Skip to content

Commit 6bc34d1

Browse files
committed
Prep for release
Delete future examples and clean up a comment and the readme
1 parent 37068f9 commit 6bc34d1

File tree

4 files changed

+32
-14
lines changed

4 files changed

+32
-14
lines changed

README.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,38 @@ An Implementation of the Ant+ Network on top of ant-arduino
2424
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:
2525

2626
```
27-
28-
29-
// Wait for the responses
27+
AntWithCallbacks ant = AntWithCallbacks();
28+
AntPlusRouter router = AntPlusRouter();
29+
ProfileHeartRateMonitor hr = ProfileHeartRateMonitor(WILDCARD_DEVICE);
30+
31+
void previousHeartBeatDataPageHandler(HeartRatePreviousHeartBeat& dp, uintptr_t data) {
32+
Serial.print("HR: ");
33+
Serial.println(dp.getComputedHeartRate());
34+
}
35+
36+
void setup() {
37+
Serial1.begin(BAUD_RATE);
38+
ant.setSerial(Serial1);
39+
delay(10000);
40+
41+
router.setDriver(&ant); // never touch ant again
42+
router.setAntPlusNetworkKey(NETWORK_KEY);
43+
router.setProfile(CHANNEL_0, &hr);
44+
// Delay after initial setup to wait for user to connect on serial
45+
46+
Serial.begin(BAUD_RATE);
47+
Serial.println("Running");
48+
hr.onHeartRatePreviousHeartBeat(previousHeartBeatDataPageHandler, NULL);
49+
hr.begin();
50+
// wait for pair to complete
51+
while(hr.getChannelStatus() == CHANNEL_STATUS_SEARCHING) {router.loop();};
52+
// print channel status
53+
// get sensor serial number
54+
}
55+
56+
void loop() {
57+
router.loop();
58+
}
3059
```
3160

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

examples/HeartRateSensor/HeartRateSensor.ino

Lines changed: 0 additions & 8 deletions
This file was deleted.

examples/MultipleProfiles/MultipleProfiles.ino

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/BaseClasses/ANTPLUS_BaseProfile.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ class BaseProfile {
7777
virtual void onChannelStatus(ChannelStatus& msg);
7878
void setRouter(AntPlusRouter* router);
7979
void setChannelNumber(uint8_t channel);
80-
// TODO this should probably have the whole message passed in so
81-
// profiles like bikelights don't get confused.
8280
// Alternative is classes requiring 2 channels will register a child
8381
// profile into the following slots and redirect all traffic back
8482
void setChannelStatus(uint8_t status);

0 commit comments

Comments
 (0)