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.
The BSC Receiver application has three versions: Speed Receiver, Cadence Receiver, and Combined Speed and Cadence Receiver. You can select the receiver version by using the "DISPLAY_TYPE" field in the sdk_config.h
file.
Each version of the BSC 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 the project file of the example in the following folder: <InstallFolder>\examples\ant\ant_plus\ant_bsc\bsc_rx
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 BSC Transmitter application has three versions: Speed Transmitter, Cadence Transmitter, and Combined Speed and Cadence Transmitter. You can select the transmitter version by using the "SENSOR_TYPE" field in the sdk_config.h
file.
Each version of the 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 ways to modify the profile information (speed and/or cadence) for each version of the Transmitter application:
You can select how the profile information is modified by using the "MODIFICATION_TYPE" field 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_bsc\bsc_tx
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 SoftDevice ANT event handler configuration.
You can test the Bicycle Speed and Cadence examples in different ways:
Note that UART is not available when you use the D52 Starter Kit from Garmin Canada.
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.