Ligne 2 : |
Ligne 2 : |
| | | |
| {{traduction}} | | {{traduction}} |
− | == Le croquis Surveillance Cardiaque == | + | == Le croquis HeartRateMonitor == |
| The '''HeartRateMonitor''' example allows you to define a new GATT Service and associated GATT Characteristics, and update the characteristic values using standard AT commands. | | The '''HeartRateMonitor''' example allows you to define a new GATT Service and associated GATT Characteristics, and update the characteristic values using standard AT commands. |
| + | |
| + | == Ouvrir le Croquis == |
| + | To open the ATCommand sketch, click on the '''File > Examples > Adafruit_BluefruitLE_nRF51''' folder in the Arduino IDE and select '''heartratemonitor''': |
| + | |
| + | {{ADFImage|Bluefruit-LE-Shield-HeartRateMonitor-00.png}} |
| + | |
| + | This will open up a new instance of the example in the IDE, as shown below: |
| + | |
| + | {{ADFImage|Bluefruit-LE-Shield-HeartRateMonitor-01.png}} |
| + | |
| + | == Configuration == |
| + | Check the '''Configuration!''' page earlier to set up the sketch for Software/Hardware UART or Software/Hardware SPI. The default is hardware SPI |
| + | |
| + | === If Using Hardware or Software UART === |
| + | This tutorial does not need to use the MODE pin, '''make sure you have the mode switch in CMD mode''' if you do not configure & connect a MODE pin |
| + | |
| + | This demo uses some long data transfer strings, so we recommend defining and connecting both CTS and RTS to pins, even if you are using hardware serial. |
| + | |
| + | If you are using a Flora or just dont want to connect CTS or RTS, set the pin #define's to -1 and '''Don't forget to also connect the CTS pin on the Bluefruit to ground!''' (The Flora has this already done) |
| + | |
| + | If you are using RTS and CTS, you can remove this line below, which will slow down the data transmission |
| + | |
| + | <syntaxhighlight lang="c"> |
| + | // this line is particularly required for Flora, but is a good idea |
| + | // anyways for the super long lines ahead! |
| + | ble.setInterCharWriteDelay(5); // 5 ms |
| + | </syntaxhighlight> |
| + | |
| + | == Exécuter le croquis == |
| + | Once you upload the sketch to your board (via the arrow-shaped upload icon), and the upload process has finished, open up the Serial Monitor via '''Tools > Serial Monitor''', and make sure that the baud rate in the lower right-hand corner is set to '''115200''': |
| + | |
| + | {{ADFImage|Bluefruit-LE-Shield-HeartRateMonitor-10.png}} |
| + | |
| + | {{ADFImage|Bluefruit-LE-Shield-HeartRateMonitor-11.png}} |
| + | |
| + | If you open up an application on your mobile device or laptop that support the standard [https://developer.bluetooth.org/TechnologyOverview/Pages/HRS.aspx Heart Rate Monitor Service], you should be able to see the heart rate being updated in sync with the changes seen in the Serial Monitor: |
| + | |
| + | == Exemple HRM de la boite à outil nRF == |
| + | The image below is a screenshot from the free nRF Toolbox application from Nordic on Android (also available on iOS), showing the incoming Heart Rate Monitor data: |
| + | |
| + | {{ADFImage|Bluefruit-LE-Shield-HeartRateMonitor-20.png}} |
| + | |
| + | == Exemple HRM CoreBluetooth == |
| + | The image below is from a freely available [https://developer.apple.com/library/mac/samplecode/HeartRateMonitor/Introduction/Intro.html CoreBluetooth sample application] from Apple showing how to work with Bluetooth Low Energy services and characteristics: |
| + | |
| + | {{ADFImage|Bluefruit-LE-Shield-HeartRateMonitor-30.png}} |
| + | |
| {{Bluefruit-LE-Shield-TRAILER}} | | {{Bluefruit-LE-Shield-TRAILER}} |