Important: Before you run this example, make sure to program the SoftDevice.
The Stride Based Speed and Distance example applications show the usage of the Stride Based Speed and Distance Monitor profile.
The Receiver application connects to the nearest stride based speed and distance monitor (SDM) 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_sdm\sdm_rx
Page data requests can be sent by pressing the following buttons:
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 Transmitter application is a Stride Based Speed and Distance (SDM) transmitter simulator. It transmits ANT_SDM_PAGE_1 and ANT_SDM_PAGE_2 as supplementary data pages. Pages ANT_SDM_PAGE_80 and ANT_SDM_PAGE_81 are transmitted at a slower rate.
The example prints outgoing page data. The actual channel state is indicated by the ANT channel state indicator.
This example automatically answers to the page data requests.
The profile information is generated by the ANT SDM simulator.
There are two ways to modify the profile information (speed and distance):
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_sdm\sdm_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 ANT stack configuration.
You can test the SDM measurement 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:
ANT SDM channel 0 init ANT SDM channel 0 open SDM Page number 1 Update latency 0.000 s Time 0.000 s Distance 0.0m Strides 0 Speed 0.00 m/s SDM Page number 1 Update latency 0.250 s Time 0.250 s Distance 0.0m Strides 0 Speed 0.76 m/s SDM Page number 2 Status: state: Active health: OK battery: Good location: Ankle Cadence 62.0 strides/min Speed 0.77 m/s SDM Page number 2 Status: state: Active health: OK battery: Good location: Ankle Cadence 63.0 strides/min Speed 0.79 m/s SDM Page number 1 Update latency 0.031 s Time 0.995 s Distance 0.8m Strides 1 Speed 0.80 m/s SDM Page number 1 Update latency 0.281 s Time 1.240 s Distance 0.8m Strides 1 Speed 0.81 m/s
The following information should be output on the console for the receiver:
ANT SDM channel 0 init ANT SDM channel 0 open SDM Page number 1 Update latency 0.500 s Time 3.225 s Distance 2.3m Strides 3 Speed 0.91 m/s Page was updated SDM Page number 2 Status: state: Active health: OK battery: Good location: Ankle Cadence 74.0 strides/min Speed 0.93 m/s Page was updated SDM Page number 2 Status: state: Active health: OK battery: Good location: Ankle Cadence 75.0 strides/min Speed 0.94 m/s Page was updated SDM Page number 1 Update latency 0.406 s Time 3.970 s Distance 3.0m Strides 4 Speed 0.95 m/s Page was updated SDM Page number 1 Update latency 0.656 s Time 4.220 s Distance 3.0m Strides 4 Speed 0.96 m/s Page was updated SDM Page number 2 Status: state: Active health: OK battery: Good location: Ankle Cadence 78.0 strides/min Speed 0.98 m/s Page was updated
If you are testing the SDM Transmitter button version, observe that the cadence value increases when pressing Button 1 and decreases when pressing Button 2.
If you are testing the SDM Transmitter auto version, observe that the ccadence value periodically rises and falls.
<InstallFolder>\sdk\nrf5\examples\ant\ant_plus\ant_sdm\sdm_tx\sdm_rx_device_profile.xml
. Alternatively, you can configure the device channel manually:Received BROADCAST_DATA_0x4E :: 4e, 00-02-FF-FF-50-01-00-FF-D1 Received BROADCAST_DATA_0x4E :: 4e, 00-02-FF-FF-4F-00-FD-FF-D1 Received BROADCAST_DATA_0x4E :: 4e, 00-01-15-37-3F-00-FA-54-06 Received BROADCAST_DATA_0x4E :: 4e, 00-01-47-37-3F-00-F6-54-0E Received BROADCAST_DATA_0x4E :: 4e, 00-02-FF-FF-4C-00-F3-FF-D1 Received BROADCAST_DATA_0x4E :: 4e, 00-02-FF-FF-4B-00-F0-FF-D1 Received BROADCAST_DATA_0x4E :: 4e, 00-01-14-38-3F-C0-ED-55-0D Received BROADCAST_DATA_0x4E :: 4e, 00-01-46-38-3F-C0-EA-55-15 Received BROADCAST_DATA_0x4E :: 4e, 00-02-FF-FF-48-00-E6-FF-D1 Received BROADCAST_DATA_0x4E :: 4e, 00-02-FF-FF-47-00-E3-FF-D1Each message can be decoded according to the ANT message protocol and the Stride Based Speed and Distance 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 SDM Transmitter and the ANT+ Sensor Simulator to test the SDM Receiver. See the documentation of the ANT+ Simulator tools at thisisant.com for information about how to use these tools.