Différences entre versions de « Bluefruit-LE-Shield-HeartRateMonitor »

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche
(Page créée avec « {{Bluefruit-LE-Shield-NAV}} {{traduction}} == Le croquis Surveillance Cardiaque == The '''HeartRateMonitor''' example allows you to define a new GATT Service and associat... »)
 
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}}

Version du 21 mai 2017 à 19:39


MCHobby investit du temps et de l'argent dans la réalisation de traduction et/ou documentation. C'est un travail long et fastidieux réalisé dans l'esprit Open-Source... donc gratuit et librement accessible.
SI vous aimez nos traductions et documentations ALORS aidez nous à en produire plus en achetant vos produits chez MCHobby.

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.

Ouvrir le Croquis

To open the ATCommand sketch, click on the File > Examples > Adafruit_BluefruitLE_nRF51 folder in the Arduino IDE and select heartratemonitor:

{{{2}}}
Crédit: AdaFruit Industries www.adafruit.com

This will open up a new instance of the example in the IDE, as shown below:

{{{2}}}
Crédit: AdaFruit Industries www.adafruit.com

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

// this line is particularly required for Flora, but is a good idea 
  // anyways for the super long lines ahead!
  ble.setInterCharWriteDelay(5); // 5 ms

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:

{{{2}}}
Crédit: AdaFruit Industries www.adafruit.com

{{{2}}}
Crédit: AdaFruit Industries www.adafruit.com

If you open up an application on your mobile device or laptop that support the standard 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:

{{{2}}}
Crédit: AdaFruit Industries www.adafruit.com

Exemple HRM CoreBluetooth

The image below is from a freely available CoreBluetooth sample application from Apple showing how to work with Bluetooth Low Energy services and characteristics:

{{{2}}}
Crédit: AdaFruit Industries www.adafruit.com


Basé sur "Bluefruit LE Shield" d'Adafruit Industries, écrit par Kevin Townsend - Traduit en Français par shop.mchobby.be CC-BY-SA pour la traduction
Toute copie doit contenir ce crédit, lien vers cette page et la section "crédit de traduction".

Based on "Bluefruit LE Shield" from Adafruit Industries, written by Kevin Townsend - Translated to French by shop.mchobby.be CC-BY-SA for the translation
Copies must includes this credit, link to this page and the section "crédit de traduction" (translation credit).

Traduit avec l'autorisation d'AdaFruit Industries - Translated with the permission from Adafruit Industries - www.adafruit.com