Important: Before you run this example, make sure to program the SoftDevice.
The Bicycle Power example applications show the usage of the Bicycle Power Monitor profile.
The Receiver application connects to the nearest Bicycle Power Sensor in range. It starts printing out page data on UART when data is received from that device. The actual channel state is indicated by the ANT channel state indicator.
You can find the source code and the project file of the example in the following folder: <InstallFolder>\examples\ant\ant_plus\ant_bpwr\bpwr_rx
The Bicycle Power Receiver implementation covers all features that are required for the Receiver to be fully compliant with the ANT+ Bike Power profile, as defined by the ANT+ Bicycle Power profile specification. For details, see the Bicycle Power Monitor.
The simple user interface consists of Button 1, which allows the user to start a manual zero-offset calibration procedure. The actual channel state is indicated by the ANT channel state indicator.
If a time-out occurs during search (30 seconds by default), the ANT channel is closed and the device is put into sleep mode. To wake it up, press Button 4. You can also put the device in sleep mode by pressing Button 4 while it is searching (see BSP ANT Button Module).
The Bicycle Power sensor implementation covers all features that are required for the Sensor to be compliant with the ANT+ Bike Power profile, as defined by the ANT+ Bicycle Power profile specification. For details, see the Bicycle Power Monitor. The example application prints outgoing page data. The actual channel state is indicated by the ANT channel state indicator.
The profile information is generated by the ANT BPWR simulator.
Several variants of the Sensor example are available:
You can select your setup by setting the "SENSOR_TYPE" and "MODIFICATION_TYPE" fields in the sdk_config.h
file.
You can find the source code and the project file of the example in the following folder: <InstallFolder>\examples\ant\ant_plus\ant_bpwr\bpwr_tx
The simple user interface consists of Button 3, which allows the user to respond to the calibration procedure.
Note: You can use a custom channel or encryption when running any of the ANT examples. When adding a new channel or encryption, remember to update ANT stack configuration.
You can test the Bicycle Power example in different ways:
Note that UART is not available when you use the Dynastream D52 Starter Kit.
The following information should be output on the console for the transmitter:
B-PWR tx page: 16 event count: 0 pedal power: 23 % instantaneous cadence: 42 rpm accumulated power: 4568 W instantaneous power: 72 W B-PWR tx page: 16 event count: 0 pedal power: 23 % instantaneous cadence: 42 rpm accumulated power: 4568 W instantaneous power: 72 W B-PWR tx page: 80 hw revision: 127 manufacturer id: 43690 model number: 21845 B-PWR tx page: 81 sw revision: 170 serial number: 2857740885 B-PWR tx page: 16 event count: 0 pedal power: 23 % instantaneous cadence: 42 rpm accumulated power: 4568 W instantaneous power: 72 W
The following information should be output on the console for the receiver:
B-PWR rx page: 16 event count: 114 pedal power: 50 % instantaneous cadence: 90 rpm accumulated power: 32262 W instantaneous power: 283 W B-PWR rx page: 16 event count: 115 pedal power: 50 % instantaneous cadence: 90 rpm accumulated power: 32545 W instantaneous power: 283 W B-PWR rx page: 81 sw revision: 1 serial number: 1234567890 B-PWR rx page: 16 event count: 116 pedal power: 50 % instantaneous cadence: 90 rpm accumulated power: 32828 W instantaneous power: 283 W B-PWR rx page: 16 event count: 117 pedal power: 50 % instantaneous cadence: 90 rpm accumulated power: 33111 W instantaneous power: 283 W
If you are testing the Bicycle Power Sensor, observe that the computed instantaneous power value increases when pressing Button 1 and decreases when pressing Button 2. Pressing Button 3 answers to a calibration request.
If you are testing the Bicycle Power Receiver, observe that pressing Button 1 initializes a calibration transaction. The calibration log on the Receiver console should look like this:
B-PWR tx page: 1 calibration id: 170 Start calibration process B-PWR rx page: 16 event count: 170 pedal power: 50 % instantaneous cadence: 90 rpm accumulated power: 3310 W instantaneous power: 283 W B-PWR rx page: 16 event count: 170 pedal power: 50 % instantaneous cadence: 90 rpm accumulated power: 3310 W instantaneous power: 283 W B-PWR rx page: 1 calibration id: 172 auto zero status: 255 Calibration data: 478
<InstallFolder>\examples\ant\ant_plus\ant_bpwr\bpwr_rx\bpwr_rx_device_profile.xml
. Alternatively, you can configure the device channel manually::: 4e, 00-10-00-17-2A-D8-11-00-00 Received BROADCAST_DATA_0x4E :: 4e, 00-10-00-17-2A-D8-11-00-00 Received BROADCAST_DATA_0x4E :: 4e, 00-10-00-17-2A-D8-11-00-00 Received BROADCAST_DATA_0x4E :: 4e, 00-10-00-17-2A-D8-11-00-00 Received BROADCAST_DATA_0x4E :: 4e, 00-10-00-17-2A-D8-11-00-00 Received BROADCAST_DATA_0x4E :: 4e, 00-10-00-17-2A-D8-11-00-00 Received BROADCAST_DATA_0x4E :: 4e, 00-10-00-17-2A-D8-11-00-00 Received BROADCAST_DATA_0x4E :: 4e, 00-10-00-17-2A-D8-11-00-00 Received BROADCAST_DATA_0x4E :: 4e, 00-10-00-17-2A-D8-11-00-00 Received BROADCAST_DATA_0x4E :: 4e, 00-10-00-17-2A-D8-11-00-00 Received BROADCAST_DATA_0x4E :: 4e, 00-10-00-17-2A-D8-11-00-00Each message can be decoded according to the ANT message protocol and the Bicycle Power ANT+ device profile.
To use the ANT+ Simulator tools, you must set the ANT+ Network Key to a proper value.
You can then use the ANT+ Display Simulator to test the Bicycle Power Sensor and the ANT+ Sensor Simulator to test the Bicycle Power Receiver. See the documentation of the ANT+ Simulator tools at thisisant.com for information about how to use these tools.