oled_sensor

Dependencies:   max32630fthr Adafruit_FeatherOLED_2020 USBDevice

Committer:
jonaangelica
Date:
Wed Mar 04 22:49:12 2020 +0000
Revision:
7:01495eb5d086
Parent:
0:cc636f742803
comm;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jonaangelica 0:cc636f742803 1 # BLE Heart Rate Monitor
jonaangelica 0:cc636f742803 2
jonaangelica 0:cc636f742803 3 This application transmits a heart rate value using the [Bluetooth SIG Heart Rate Profile](https://developer.bluetooth.org/TechnologyOverview/Pages/HRP.aspx). The heart rate value is provided by the application itself, not by a sensor, so that you don't have to get a sensor just to run the example.
jonaangelica 0:cc636f742803 4
jonaangelica 0:cc636f742803 5 Technical details are better presented [in the mbed Classic equivalent of this example](https://developer.mbed.org/teams/Bluetooth-Low-Energy/code/BLE_HeartRate/).
jonaangelica 0:cc636f742803 6
jonaangelica 0:cc636f742803 7 # Running the application
jonaangelica 0:cc636f742803 8
jonaangelica 0:cc636f742803 9 ## Requirements
jonaangelica 0:cc636f742803 10
jonaangelica 0:cc636f742803 11 To see the heart rate information on your phone, download Panobike for [iOS](https://itunes.apple.com/gb/app/panobike/id567403997?mt=8) or [Android](https://play.google.com/store/apps/details?id=com.topeak.panobike&hl=en).
jonaangelica 0:cc636f742803 12
jonaangelica 0:cc636f742803 13 You could also use a generic BLE scanners:
jonaangelica 0:cc636f742803 14
jonaangelica 0:cc636f742803 15 - [nRF Master Control Panel](https://play.google.com/store/apps/details?id=no.nordicsemi.android.mcp) for Android.
jonaangelica 0:cc636f742803 16
jonaangelica 0:cc636f742803 17 - [LightBlue](https://itunes.apple.com/gb/app/lightblue-bluetooth-low-energy/id557428110?mt=8) for iPhone.
jonaangelica 0:cc636f742803 18
jonaangelica 0:cc636f742803 19 Hardware requirements are in the [main readme](https://github.com/ARMmbed/mbed-os-example-ble/blob/master/README.md).
jonaangelica 0:cc636f742803 20
jonaangelica 0:cc636f742803 21 ## Building instructions
jonaangelica 0:cc636f742803 22
jonaangelica 0:cc636f742803 23 Building instructions for all samples are in the [main readme](https://github.com/ARMmbed/mbed-os-example-ble/blob/master/README.md).
jonaangelica 0:cc636f742803 24
jonaangelica 0:cc636f742803 25 ## Checking for success
jonaangelica 0:cc636f742803 26
jonaangelica 0:cc636f742803 27 **Note:** Screens captures depicted below show what is expected from this example if the scanner used is *nRF Master Control Panel* version 4.0.5. If you encounter any difficulties consider trying another scanner or another version of nRF Master Control Panel. Alternative scanners may require reference to their manuals.
jonaangelica 0:cc636f742803 28
jonaangelica 0:cc636f742803 29 1. Build the application and install it on your board as explained in the building instructions.
jonaangelica 0:cc636f742803 30 1. Open the BLE scanner on your phone.
jonaangelica 0:cc636f742803 31 1. Start a scan.
jonaangelica 0:cc636f742803 32
jonaangelica 0:cc636f742803 33 ![](img/start_scan.png)
jonaangelica 0:cc636f742803 34
jonaangelica 0:cc636f742803 35 **figure 1** How to start scan using nRF Master Control Panel 4.0.5
jonaangelica 0:cc636f742803 36
jonaangelica 0:cc636f742803 37 1. Find your device; it should be named `HRM`.
jonaangelica 0:cc636f742803 38
jonaangelica 0:cc636f742803 39 ![](img/scan_result.png)
jonaangelica 0:cc636f742803 40
jonaangelica 0:cc636f742803 41 **figure 2** Scan results using nRF Master Control Panel 4.0.5
jonaangelica 0:cc636f742803 42
jonaangelica 0:cc636f742803 43 1. Establish a connection with your device.
jonaangelica 0:cc636f742803 44
jonaangelica 0:cc636f742803 45 ![](img/connection.png)
jonaangelica 0:cc636f742803 46
jonaangelica 0:cc636f742803 47 **figure 3** How to establish a connection using Master Control Panel 4.0.5
jonaangelica 0:cc636f742803 48
jonaangelica 0:cc636f742803 49 1. Discover the services and the characteristics on the device. The *Heart Rate* service has the UUID `0x180D` and includes the *Heart Rate Measurement* characteristic which has the UUID `0x2A37`.
jonaangelica 0:cc636f742803 50
jonaangelica 0:cc636f742803 51 ![](img/discovery.png)
jonaangelica 0:cc636f742803 52
jonaangelica 0:cc636f742803 53 **figure 4** Representation of the Heart Rate service using Master Control Panel 4.0.5
jonaangelica 0:cc636f742803 54
jonaangelica 0:cc636f742803 55 1. Register for the notifications sent by the *Heart Rate Measurement* characteristic.
jonaangelica 0:cc636f742803 56
jonaangelica 0:cc636f742803 57 ![](img/register_to_notifications.png)
jonaangelica 0:cc636f742803 58
jonaangelica 0:cc636f742803 59 **figure 5** How to register to notifications using Master Control Panel 4.0.5
jonaangelica 0:cc636f742803 60
jonaangelica 0:cc636f742803 61
jonaangelica 0:cc636f742803 62 1. You should see the heart rate value change every half second. It begins at 100, goes up to 175 (in steps of 1), resets to 100 and so on.
jonaangelica 0:cc636f742803 63
jonaangelica 0:cc636f742803 64 ![](img/notifications.png)
jonaangelica 0:cc636f742803 65
jonaangelica 0:cc636f742803 66 **figure 6** Notifications view using Master Control Panel 4.0.5