Important: Before you run this example, make sure to program the SoftDevice.
The combined Bicycle Speed and Cadence (BSC) example applications show the usage of the Bicycle Speed and Cadence profile.
There are three BSC Receiver applications: Speed Receiver, Cadence Receiver, and Combined Speed and Cadence Receiver.
Each Receiver application connects to the nearest bicycle speed and/or cadence sensor in range and prints out incoming page data. The actual channel state is indicated by the ANT channel state indicator.
You can find the source code and project file of the example in the following folder: <InstallFolder>\examples\ant\ant_plus\ant_bsc\bsc_rx
There are three BSC Transmitter applications: Speed Transmitter, Cadence Transmitter, and Combined Speed and Cadence Transmitter.
Each Transmitter application simulates a bicycle speed and/or cadence sensor. The Speed Transmitter and the Cadence Transmitter transmit the speed or cadence information in the main data page (page 5). Device-specific information is transmitted at a slower rate in the background data pages (pages 1-4). The Combined Speed and Cadence Transmitter transmits the speed and cadence information in the main data page (combined speed and cadence data page 0). It does not transmit background pages.
The 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 BSC simulator.
There are two varieties of each Transmitter example:
<InstallFolder>\examples\ant\ant_plus\ant_bsc\bsc_tx\variant\auto
<InstallFolder>\examples\ant\ant_plus\ant_bsc\bsc_tx\variant\button
You can test the Bicycle Speed and Cadence examples in different ways:
Note that UART is not available when you use the Dynastream N5 Starter Kit.
The following information should be output on the console for the Transmitter:
ANT BSC channel 0 init ANT BSC channel 0 open
BSC TX Page: "Combined Speed & Cadence Page" Cadence Revolution count: 0 Cadence event time: 0.000s Speed Revolution count: 0 Speed event time: 0.000s
BSC TX Page number: 5 Revolution count: 0 BSC event time: 0.000s Bicycle stopped.
The following information should be output on the console for the Receiver:
ANT BSC channel 0 init ANT BSC channel 0 open
BSC RX Page Number: "Combined Speed & Cadence Page" Cadence Revolution count: 31 Cadence event time: 26.550s Speed Revolution count: 0 Speed event time: 0.000s Computed speed value: 0 kph Computed cadence value: 70 rpm
BSC RX Page Number: 5 Revolution count: 0 BSC event time: 0.000s Bicycle stopped. Page was updated Computed speed value: 0 kph
If you are testing the BSC Transmitter button version, observe that the computed values increase when pressing Button 1 and decrease when pressing Button 2.
If you are testing the BSC Transmitter auto version, observe that the computed values periodically rise and fall.
<Type>
is the type of Receiver device (speed, cadence, or combined) that you want to simulate: <InstallFolder>\examples\ant\ant_plus\ant_bsc\bsc_tx\<Type>\bsc_<Type>_rx_device_profile.xml
. Alternatively, you can configure the device channel manually:Received BROADCAST_DATA_0x4E :: 4e, 00-05-01-FF-FF-43-5C-6A-09 Received BROADCAST_DATA_0x4E :: 4e, 00-05-01-FF-FF-43-5C-6A-09 Received BROADCAST_DATA_0x4E :: 4e, 00-05-01-FF-FF-43-5C-6A-09 Received BROADCAST_DATA_0x4E :: 4e, 00-84-FF-C8-22-43-5C-6A-09 Received BROADCAST_DATA_0x4E :: 4e, 00-84-FF-C8-22-43-5C-6A-09 Received BROADCAST_DATA_0x4E :: 4e, 00-84-FF-C8-22-43-5C-6A-09 Received BROADCAST_DATA_0x4E :: 4e, 00-84-FF-C8-22-43-5C-6A-09 Received BROADCAST_DATA_0x4E :: 4e, 00-05-01-FF-FF-43-5C-6A-09 Received BROADCAST_DATA_0x4E :: 4e, 00-05-01-FF-FF-43-5C-6A-09 Received BROADCAST_DATA_0x4E :: 4e, 00-05-01-FF-FF-43-5C-6A-09Each message can be decoded according to the ANT message protocol and the Bicycle Speed/Cadence Display 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 BSC Transmitter and the ANT+ Sensor Simulator to test the BSC Receiver. See the documentation of the ANT+ Simulator tools at thisisant.com for information about how to use these tools.