Bluefruit-LE-Shield-Controller

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche


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 Controler

Le croquis d'exemple Controller vous permet de transformer votre périphérique iOS ou Android (supportant BLE) en un contrôleur distant ou source de donnée externe. Cela vous permet de profiter des avantages offerts par les senseurs de votre téléphone ou tablette.

Vous pouvez acquérir les données accélérométrique (ou données quaternion Wikipedia) de votre téléphone pour les pousser vers votre Arduino via BLE. Vous pouvez également obtenir les dernière données GPS de votre mobile de la même façon (sans devoir acheter ou alimenter du matériel complémentaire).

Ouvrir le croquis

Pour ouvrir le croquis ATCommand, cliquez sur le menu Fichiers > Exemples > Adafruit_BluefruitLE_nRF51 dans Arduino IDE puis sélectionnez controller:

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

Cela ouvrira l'exemple dans l'environnement de développement, comme visible ci-dessous:

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

Configuration

Vérifiez la page Configuration présenter plus tôt dans le tutoriel! Il est important de configurer le croquis pour utiliser soit l'UART Logiciel/Matériel, soit le bus SPI Logiciel/Matériel correspondant à votre plateforme. Par défaut, le croquis utilise le bus SPI matériel

Si vous utilisez le port série/UART logiciel ou matériel:

  • Ce tutoriel ne requière pas l'utilisation de la broche MODE, assurez-vous d'avoir l'interrupteur en position CMD si vous ne configurer pas (et ne connectez pas) la broche MODE.
  • N'oubliez pas de connecter la broche CTS sur la masse/GND du Bluefruit si vous n'utilisez pas le signal CTS! (Le Flora l'a déjà branché à la masse)

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

To send keyboard data, type anything into the textbox at the top of the Serial Monitor and click the Send button.

Utiliser Bluefruit LE Connect en mode contrôleur

Once the sketch is running you can open Adafruit's Bluefruit LE Connect application (available for Android or iOS) and use the Controller application to interact with the sketch. (If you're new to Bluefruit LE Connect, have a look at our dedicated Bluefruit LE Connect learning guide (Adafruit, anglais).)

On the welcome screen, select the Adafruit Bluefruit LE device from the list of BLE devices in range:

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

Then from the activity list select Controller:

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

This will bring up a list of data points you can send from your phone or tablet to your Bluefruit LE module, by enabling or disabling the appropriate sensor(s).

Streamer les données de senseur

You can take Quaternion (absolute orientation), Accelerometer, Gyroscope, Magnetometer or GPS Location data from your phone and send it directly to your Arduino from the Controller activity.

By enabling the Accelerometer field, for example, you should see accelerometer data update in the app:

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

The data is parsed in the example sketch and output to the Serial Monitor as follows:

Accel	0.20	-0.51	-0.76
Accel	0.22	-0.50	-0.83
Accel	0.25	-0.51	-0.83
Accel	0.21	-0.47	-0.76
Accel	0.27	-0.48	-0.82

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

Note that even though we only print 2 decimal points, the values are received from the App as a full 4-byte floating point.

Le pavé de commande

You can also use the Control Pad Module to capture button presses and releases by selecting the appropriate menu item:

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

This will bring up the Control Pad panel, shown below:

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

Button presses and releases will all be logged to the Serial Monitor with the ID of the button used:

Button 8 pressed
Button 8 released
Button 3 pressed
Button 3 released

Sélection de couleur

You can also send RGB color data via the Color Picker module, which presents the following color selection dialogue:

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

This will give you Hexadecimal color data in the following format:

RGB #A42FFF

Voyez cette vidéo d'exemple produit par Adafruit (Youtube, anglais)

You can combine the color picker and controller sample sketches to make color-configurable animations triggered by buttons in the mobile app-- very handy for wearables! Download this combined sample code (configured for Feather but easy to adapt to FLORA, BLE Micro, etc.) to get started:

Download-icon.pngfeather_bluefruit_neopixel_
animation_controller.zip

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