Modifications

Sauter à la navigation Sauter à la recherche
4 040 octets ajoutés ,  21 mai 2017 à 19:05
Ligne 14 : Ligne 14 :     
{{ADFImage|Bluefruit-LE-Shield-HIDKeyboard-01.png}}
 
{{ADFImage|Bluefruit-LE-Shield-HIDKeyboard-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 software or hardware Serial 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
 +
* Don't forget to also '''connect the CTS pin on the Bluefruit to ground if you are not using it!''' (The Flora has this already done)
 +
 +
== 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-HIDKeyboard-10.png}}
 +
 +
== Utiliser Bluefruit LE Connect en mode contrôleur ==
 +
Once the sketch is running you can open Adafruit's Bluefruit LE Connect application (available for [https://play.google.com/store/apps/details?id=com.adafruit.bluefruit.le.connect Android] or [https://itunes.apple.com/app/adafruit-bluefruit-le-connect/id830125974?mt=8 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 [https://learn.adafruit.com/bluefruit-le-connect-for-ios/settings 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:
 +
 +
{{ADFImage|Bluefruit-LE-Shield-HIDKeyboard-20.jpg}}
 +
 +
Then from the activity list select Controller:
 +
 +
{{ADFImage|Bluefruit-LE-Shield-HIDKeyboard-21.jpg}}
 +
 +
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:
 +
 +
{{ADFImage|Bluefruit-LE-Shield-HIDKeyboard-30.jpg}}
 +
 +
The data is parsed in the example sketch and output to the Serial Monitor as follows:
 +
 +
<nowiki>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</nowiki>
 +
 +
{{ADFImage|Bluefruit-LE-Shield-HIDKeyboard-31.png}}
 +
 +
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:
 +
 +
{{ADFImage|Bluefruit-LE-Shield-HIDKeyboard-40.jpg}}
 +
 +
This will bring up the Control Pad panel, shown below:
 +
 +
{{ADFImage|Bluefruit-LE-Shield-HIDKeyboard-41.png}}
 +
 +
Button presses and releases will all be logged to the Serial Monitor with the ID of the button used:
 +
 +
<nowiki>Button 8 pressed
 +
Button 8 released
 +
Button 3 pressed
 +
Button 3 released</nowiki>
 +
 +
== Sélection de couleur ==
 +
You can also send RGB color data via the '''Color Picker module''', which presents the following color selection dialogue:
 +
 +
{{ADFImage|Bluefruit-LE-Shield-HIDKeyboard-50.jpg}}
 +
 +
This will give you Hexadecimal color data in the following format:
 +
 +
<nowiki>RGB #A42FFF</nowiki>
 +
 +
{{#Widget:Iframe
 +
|url=https://youtu.be/Kym6crZF1Pg
 +
|width=560
 +
|height=315
 +
|border=0
 +
}}
 +
 +
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-box|feather_bluefruit_neopixel_animation_controller.zip|https://learn.adafruit.com/system/assets/assets/000/029/260/original/feather_bluefruit_neopixel_animation_controller.zip?1450791688}}
    
== Configuration ==
 
== Configuration ==
29 917

modifications

Menu de navigation